mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
Rename globalconf.client_focus to focus.client
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
fe43b99a2a
commit
f931af7ce1
4 changed files with 17 additions and 13 deletions
4
ewmh.c
4
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;
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
2
stack.c
2
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;
|
||||
|
|
Loading…
Reference in a new issue