Clear our event mask in client_unmanage()

This should fix an actual race condition:
- Client unmaps its window (UnmapNotify for awesome)
- Client maps its window (MapRequest for awesome)
- Due to the UnmapNotify: client_unmanage() runs and reparents the window back
  to the root (ReparentNotify)
- Due to the MapRequest: client_manage() runs
- Due to the ReparentNotify: We call client_unmanage() again and now the
  client's window is lost.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-08-09 11:51:49 +02:00
parent c36ee7fea8
commit 0eb9363533
1 changed files with 7 additions and 0 deletions

View File

@ -1043,6 +1043,13 @@ client_unmanage(client_t *c)
ewmh_update_net_client_list(c->phys_screen);
/* Clear our event mask so that we don't receive any events from now on,
* especially not for the following requests. */
xcb_change_window_attributes(globalconf.connection,
c->window,
XCB_CW_EVENT_MASK,
(const uint32_t []) { 0 });
xcb_screen_t *s = xutil_screen_get(globalconf.connection, c->phys_screen);
xcb_unmap_window(globalconf.connection, c->window);
xcb_reparent_window(globalconf.connection, c->window, s->root,