From 053ae6dce6638955ccada540548f0bcf4871d6cc Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 23 Jul 2008 09:20:25 +0200 Subject: [PATCH] client: check for focus on unmanage before removing client Signed-off-by: Julien Danjou --- client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.c b/client.c index 68499cdaf..966b632cb 100644 --- a/client.c +++ b/client.c @@ -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);