From 6b2e4352bbcf42e616a1a31291dcb98266795ec5 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 16 Aug 2010 14:20:45 +0200 Subject: [PATCH] Remove globalconf.xinerama_is_active Signed-off-by: Uli Schlachter --- globalconf.h | 2 -- luadoc/awesome.lua | 1 - luadoc/root.lua | 2 -- objects/client.c | 10 ++++------ property.c | 10 ++-------- root.c | 10 +--------- screen.c | 14 ++++---------- spawn.c | 17 ----------------- 8 files changed, 11 insertions(+), 55 deletions(-) diff --git a/globalconf.h b/globalconf.h index b61f14588..242fb3a7e 100644 --- a/globalconf.h +++ b/globalconf.h @@ -59,8 +59,6 @@ typedef struct xcb_key_symbols_t *keysyms; /** Logical screens */ screen_array_t screens; - /** True if xinerama is active */ - bool xinerama_is_active; /** Root window key bindings */ key_array_t keys; /** Root window mouse bindings */ diff --git a/luadoc/awesome.lua b/luadoc/awesome.lua index b5e966659..c206bae8c 100644 --- a/luadoc/awesome.lua +++ b/luadoc/awesome.lua @@ -33,7 +33,6 @@ module("awesome") --- Spawn a program. -- @param cmd The command to launch. -- @param use_sn Use startup-notification, true or false, default to true. --- @param screen Optional screen number to spawn the command on. -- @return Process ID if everything is OK, or an error string if an error occured. --- Add a global signal. diff --git a/luadoc/root.lua b/luadoc/root.lua index 83bff2202..39f885249 100644 --- a/luadoc/root.lua +++ b/luadoc/root.lua @@ -30,8 +30,6 @@ module("root") -- event, this is a boolean value which if true make the coordinates relatives. -- @param x In case of a motion event, this is the X coordinate. -- @param y In case of a motion event, this is the Y coordinate. --- @param screen In case of a motion event, this is the screen number to move on. --- If not specified, the current one is used. -- @name fake_input -- @class function diff --git a/objects/client.c b/objects/client.c index 0125126e5..6ab249c0f 100644 --- a/objects/client.c +++ b/objects/client.c @@ -1360,12 +1360,10 @@ luaA_client_geometry(lua_State *L) static int luaA_client_set_screen(lua_State *L, client_t *c) { - if(globalconf.xinerama_is_active) - { - int screen = luaL_checknumber(L, -1) - 1; - luaA_checkscreen(screen); - screen_client_moveto(c, &globalconf.screens.tab[screen], true); - } + int screen = luaL_checknumber(L, -1) - 1; + luaA_checkscreen(screen); + screen_client_moveto(c, &globalconf.screens.tab[screen], true); + return 0; } diff --git a/property.c b/property.c index 3c2e8181a..634366a63 100644 --- a/property.c +++ b/property.c @@ -332,14 +332,8 @@ static int property_handle_xrootpmap_id(uint8_t state, xcb_window_t window) { - if(globalconf.xinerama_is_active) - foreach(w, globalconf.wiboxes) - (*w)->need_update = true; - else - { - foreach(w, globalconf.wiboxes) - (*w)->need_update = true; - } + foreach(w, globalconf.wiboxes) + (*w)->need_update = true; return 0; } diff --git a/root.c b/root.c index 2a9bcf804..b160fc13f 100644 --- a/root.c +++ b/root.c @@ -41,7 +41,6 @@ * event, this is a boolean value which if true make the coordinates relatives. * \lparam In case of a motion event, this is the X coordinate. * \lparam In case of a motion event, this is the Y coordinate. - * \lparam In case of a motion event, this is the screen number to move on. * If not specified, the current one is used. */ static int @@ -57,7 +56,6 @@ luaA_root_fake_input(lua_State *L) const char *stype = luaL_checklstring(L, 1, &tlen); uint8_t type, detail; int x = 0, y = 0; - xcb_window_t root = XCB_NONE; switch(a_tokenize(stype, tlen)) { @@ -82,12 +80,6 @@ luaA_root_fake_input(lua_State *L) detail = luaA_checkboolean(L, 2); /* relative to the current position or not */ x = luaL_checknumber(L, 3); y = luaL_checknumber(L, 4); - if(lua_gettop(L) == 5 && !globalconf.xinerama_is_active) - { - int screen = luaL_checknumber(L, 5) - 1; - luaA_checkscreen(screen); - root = globalconf.screen->root; - } break; default: return 0; @@ -97,7 +89,7 @@ luaA_root_fake_input(lua_State *L) type, detail, XCB_CURRENT_TIME, - root, + XCB_NONE, x, y, 0); return 0; diff --git a/screen.c b/screen.c index 65e20cf85..d8612d1ee 100644 --- a/screen.c +++ b/screen.c @@ -145,10 +145,6 @@ screen_scan_randr(void) p_delete(&screen_res_r); - /* If RandR provides more than 2 active CRTC, Xinerama is enabled */ - if(globalconf.screens.len > 1) - globalconf.xinerama_is_active = true; - return true; } } @@ -159,16 +155,18 @@ screen_scan_randr(void) static bool screen_scan_xinerama(void) { + bool xinerama_is_active = false; + /* Check for extension before checking for Xinerama */ if(xcb_get_extension_data(globalconf.connection, &xcb_xinerama_id)->present) { xcb_xinerama_is_active_reply_t *xia; xia = xcb_xinerama_is_active_reply(globalconf.connection, xcb_xinerama_is_active(globalconf.connection), NULL); - globalconf.xinerama_is_active = xia->state; + xinerama_is_active = xia->state; p_delete(&xia); } - if(globalconf.xinerama_is_active) + if(xinerama_is_active) { xcb_xinerama_query_screens_reply_t *xsq; xcb_xinerama_screen_info_t *xsi; @@ -249,10 +247,6 @@ screen_scan(void) screen_t * screen_getbycoord(screen_t *screen, int x, int y) { - /* don't waste our time */ - if(!globalconf.xinerama_is_active) - return screen; - foreach(s, globalconf.screens) if((x < 0 || (x >= s->geometry.x && x < s->geometry.x + s->geometry.width)) && (y < 0 || (y >= s->geometry.y && y < s->geometry.y + s->geometry.height))) diff --git a/spawn.c b/spawn.c index 329874e80..cb90fce54 100644 --- a/spawn.c +++ b/spawn.c @@ -283,36 +283,19 @@ spawn_command(const gchar *command_line, GError **error) * \luastack * \lparam The command to launch. * \lparam Use startup-notification, true or false, default to true. - * \lparam The optional screen number to spawn the command on. * \lreturn Process ID if everything is OK, or an error string if an error occured. */ int luaA_spawn(lua_State *L) { - char *host, newdisplay[128]; const char *cmd; bool use_sn = true; - int screen = 0, screenp, displayp; if(lua_gettop(L) >= 2) use_sn = luaA_checkboolean(L, 2); - if(lua_gettop(L) == 3) - { - screen = luaL_checknumber(L, 3) - 1; - luaA_checkscreen(screen); - } - cmd = luaL_checkstring(L, 1); - if(!globalconf.xinerama_is_active) - { - xcb_parse_display(NULL, &host, &displayp, &screenp); - snprintf(newdisplay, sizeof(newdisplay), "%s:%d.%d", host, displayp, screen); - setenv("DISPLAY", newdisplay, 1); - p_delete(&host); - } - SnLauncherContext *context = NULL; if(use_sn) {