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
ewmh.c
4
ewmh.c
|
@ -93,8 +93,8 @@ ewmh_update_net_active_window(lua_State *L)
|
||||||
{
|
{
|
||||||
xcb_window_t win;
|
xcb_window_t win;
|
||||||
|
|
||||||
if(globalconf.client_focus)
|
if(globalconf.focus.client)
|
||||||
win = globalconf.client_focus->window;
|
win = globalconf.focus.client->window;
|
||||||
else
|
else
|
||||||
win = XCB_NONE;
|
win = XCB_NONE;
|
||||||
|
|
||||||
|
|
|
@ -80,8 +80,12 @@ typedef struct
|
||||||
int keygrabber;
|
int keygrabber;
|
||||||
/** The mouse pointer grabber function */
|
/** The mouse pointer grabber function */
|
||||||
int mousegrabber;
|
int mousegrabber;
|
||||||
/** Focused client */
|
/** Input focus information */
|
||||||
client_t *client_focus;
|
struct
|
||||||
|
{
|
||||||
|
/** Focused client */
|
||||||
|
client_t *client;
|
||||||
|
} focus;
|
||||||
/** Drawins */
|
/** Drawins */
|
||||||
drawin_array_t drawins;
|
drawin_array_t drawins;
|
||||||
/** The startup notification display struct */
|
/** The startup notification display struct */
|
||||||
|
|
|
@ -187,7 +187,7 @@ client_getbyframewin(xcb_window_t w)
|
||||||
static void
|
static void
|
||||||
client_unfocus_update(client_t *c)
|
client_unfocus_update(client_t *c)
|
||||||
{
|
{
|
||||||
globalconf.client_focus = NULL;
|
globalconf.focus.client = NULL;
|
||||||
|
|
||||||
luaA_object_push(globalconf.L, c);
|
luaA_object_push(globalconf.L, c);
|
||||||
luaA_object_emit_signal(globalconf.L, -1, "unfocus", 0);
|
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)
|
void client_ban_unfocus(client_t *c)
|
||||||
{
|
{
|
||||||
/* Wait until the last moment to take away the focus from the window. */
|
/* 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);
|
client_unfocus(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,16 +296,16 @@ client_focus_update(client_t *c)
|
||||||
if(!client_maybevisible(c, c->screen))
|
if(!client_maybevisible(c, c->screen))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(globalconf.client_focus)
|
if(globalconf.focus.client)
|
||||||
{
|
{
|
||||||
if (globalconf.client_focus != c)
|
if (globalconf.focus.client != c)
|
||||||
client_unfocus_update(globalconf.client_focus);
|
client_unfocus_update(globalconf.focus.client);
|
||||||
else
|
else
|
||||||
/* Already focused */
|
/* Already focused */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalconf.client_focus = c;
|
globalconf.focus.client = c;
|
||||||
|
|
||||||
/* according to EWMH, we have to remove the urgent state from a client */
|
/* according to EWMH, we have to remove the urgent state from a client */
|
||||||
luaA_object_push(globalconf.L, c);
|
luaA_object_push(globalconf.L, c);
|
||||||
|
@ -944,7 +944,7 @@ client_unmanage(client_t *c, bool window_valid)
|
||||||
tc->transient_for = NULL;
|
tc->transient_for = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(globalconf.client_focus == c)
|
if(globalconf.focus.client == c)
|
||||||
client_unfocus(c);
|
client_unfocus(c);
|
||||||
|
|
||||||
/* remove client from global list and everywhere else */
|
/* 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);
|
const char *buf = luaL_checkstring(L, 2);
|
||||||
|
|
||||||
if(a_strcmp(buf, "focus") == 0)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
stack.c
2
stack.c
|
@ -134,7 +134,7 @@ client_layer_translator(client_t *c)
|
||||||
if(c->ontop)
|
if(c->ontop)
|
||||||
return WINDOW_LAYER_ONTOP;
|
return WINDOW_LAYER_ONTOP;
|
||||||
/* Fullscreen windows only get their own layer when they have the focus */
|
/* 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;
|
return WINDOW_LAYER_FULLSCREEN;
|
||||||
else if(c->above)
|
else if(c->above)
|
||||||
return WINDOW_LAYER_ABOVE;
|
return WINDOW_LAYER_ABOVE;
|
||||||
|
|
Loading…
Reference in New Issue