From f931af7ce1bfeca9320dfb411c9333cf23f9df19 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 10 Oct 2010 14:46:56 +0200 Subject: [PATCH] Rename globalconf.client_focus to focus.client Signed-off-by: Uli Schlachter --- ewmh.c | 4 ++-- globalconf.h | 8 ++++++-- objects/client.c | 16 ++++++++-------- stack.c | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ewmh.c b/ewmh.c index 236c941a4..be31aceda 100644 --- a/ewmh.c +++ b/ewmh.c @@ -93,8 +93,8 @@ ewmh_update_net_active_window(lua_State *L) { xcb_window_t win; - if(globalconf.client_focus) - win = globalconf.client_focus->window; + if(globalconf.focus.client) + win = globalconf.focus.client->window; else win = XCB_NONE; diff --git a/globalconf.h b/globalconf.h index 4ae07771f..2027ea763 100644 --- a/globalconf.h +++ b/globalconf.h @@ -80,8 +80,12 @@ typedef struct int keygrabber; /** The mouse pointer grabber function */ int mousegrabber; - /** Focused client */ - client_t *client_focus; + /** Input focus information */ + struct + { + /** Focused client */ + client_t *client; + } focus; /** Drawins */ drawin_array_t drawins; /** The startup notification display struct */ diff --git a/objects/client.c b/objects/client.c index 9d3f745ab..2a05f66d1 100644 --- a/objects/client.c +++ b/objects/client.c @@ -187,7 +187,7 @@ client_getbyframewin(xcb_window_t w) static void client_unfocus_update(client_t *c) { - globalconf.client_focus = NULL; + globalconf.focus.client = NULL; luaA_object_push(globalconf.L, c); luaA_object_emit_signal(globalconf.L, -1, "unfocus", 0); @@ -232,7 +232,7 @@ client_hasproto(client_t *c, xcb_atom_t atom) void client_ban_unfocus(client_t *c) { /* Wait until the last moment to take away the focus from the window. */ - if(globalconf.client_focus == c) + if(globalconf.focus.client == c) client_unfocus(c); } @@ -296,16 +296,16 @@ client_focus_update(client_t *c) if(!client_maybevisible(c, c->screen)) return; - if(globalconf.client_focus) + if(globalconf.focus.client) { - if (globalconf.client_focus != c) - client_unfocus_update(globalconf.client_focus); + if (globalconf.focus.client != c) + client_unfocus_update(globalconf.focus.client); else /* Already focused */ return; } - globalconf.client_focus = c; + globalconf.focus.client = c; /* according to EWMH, we have to remove the urgent state from a client */ luaA_object_push(globalconf.L, c); @@ -944,7 +944,7 @@ client_unmanage(client_t *c, bool window_valid) tc->transient_for = NULL; } - if(globalconf.client_focus == c) + if(globalconf.focus.client == c) client_unfocus(c); /* remove client from global list and everywhere else */ @@ -1648,7 +1648,7 @@ luaA_client_module_index(lua_State *L) const char *buf = luaL_checkstring(L, 2); if(a_strcmp(buf, "focus") == 0) - return luaA_object_push(globalconf.L, globalconf.client_focus); + return luaA_object_push(globalconf.L, globalconf.focus.client); return 0; } diff --git a/stack.c b/stack.c index 33f4365ba..75d8cb0df 100644 --- a/stack.c +++ b/stack.c @@ -134,7 +134,7 @@ client_layer_translator(client_t *c) if(c->ontop) return WINDOW_LAYER_ONTOP; /* Fullscreen windows only get their own layer when they have the focus */ - else if(c->fullscreen && globalconf.client_focus == c) + else if(c->fullscreen && globalconf.focus.client == c) return WINDOW_LAYER_FULLSCREEN; else if(c->above) return WINDOW_LAYER_ABOVE;