client_unmanage: Update WM_STATE later

According to ICCCM, if a client wants to reuse one of its windows, it has to
wait until the WM updated WM_STATE. This means updating WM_STATE should be the
very last thing we do when unmanaging a window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-08-09 11:27:13 +02:00
parent 4d9211c8c3
commit ce4088bbf7
1 changed files with 4 additions and 2 deletions

View File

@ -1311,8 +1311,6 @@ client_unmanage(client_t *c)
if(strut_has_value(&c->strut)) if(strut_has_value(&c->strut))
screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0); screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0);
window_state_set(c->window, XCB_WM_STATE_WITHDRAWN);
titlebar_client_detach(c); titlebar_client_detach(c);
ewmh_update_net_client_list(c->phys_screen); ewmh_update_net_client_list(c->phys_screen);
@ -1321,6 +1319,10 @@ client_unmanage(client_t *c)
* after a restart anymore. */ * after a restart anymore. */
xcb_change_save_set(globalconf.connection, XCB_SET_MODE_DELETE, c->window); xcb_change_save_set(globalconf.connection, XCB_SET_MODE_DELETE, c->window);
/* Do this last to avoid races with clients. According to ICCCM, clients
* arent allowed to re-use the window until after this. */
window_state_set(c->window, XCB_WM_STATE_WITHDRAWN);
/* set client as invalid */ /* set client as invalid */
c->invalid = true; c->invalid = true;