client: check for focus on unmanage before removing client

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-23 09:20:25 +02:00
parent e1fe38289b
commit 053ae6dce6
1 changed files with 3 additions and 3 deletions

View File

@ -670,6 +670,9 @@ client_unmanage(client_t *c)
luaA_client_userdata_new(globalconf.L, c);
luaA_dofunction(globalconf.L, globalconf.hooks.unmanage, 1, 0);
if(globalconf.focus->client == c)
client_focus(NULL, c->screen);
/* The server grab construct avoids race conditions. */
xcb_grab_server(globalconf.connection);
@ -684,9 +687,6 @@ client_unmanage(client_t *c)
for(int i = 0; i < tags->len; i++)
untag_client(c, tags->tab[i]);
if(globalconf.focus->client == c)
client_focus(NULL, c->screen);
xcb_ungrab_button(globalconf.connection, XCB_BUTTON_INDEX_ANY, c->win, ANY_MODIFIER);
window_setstate(c->win, XCB_WM_WITHDRAWN_STATE);