From c08b90345f2c864af9d1b4c08607376de772600a Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 21 Sep 2009 16:33:03 +0200 Subject: [PATCH] screen: export RandR information Signed-off-by: Julien Danjou --- common/tokenize.gperf | 1 + screen.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/common/tokenize.gperf b/common/tokenize.gperf index 6edf64a6..40e91549 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -65,6 +65,7 @@ name ontop opacity orientation +outputs pid release resize diff --git a/screen.c b/screen.c index 8f295c85..b7132157 100644 --- a/screen.c +++ b/screen.c @@ -516,6 +516,20 @@ luaA_screen_index(lua_State *L) case A_TK_WORKAREA: luaA_pusharea(L, screen_area_get(s, true)); break; + case A_TK_OUTPUTS: + { + lua_createtable(L, 0, s->outputs.len); + foreach(output, s->outputs) + { + lua_createtable(L, 2, 0); + lua_pushinteger(L, output->mm_width); + lua_setfield(L, -2, "mm_width"); + lua_pushinteger(L, output->mm_height); + lua_setfield(L, -2, "mm_height"); + lua_setfield(L, -2, output->name); + } + } + break; default: return 0; }