Don't destroy client windows in unmanage

When a client is unmanaged, we destroy our frame window. But since the client's
own window was still a child of the frame window, it was destroyed, too. This
commit fixes this by reparenting the client's window back to the root window
first.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-07-31 10:21:22 +02:00
parent 52f4581be3
commit a311ab0679
2 changed files with 6 additions and 3 deletions

View File

@ -630,7 +630,6 @@ event_handle_unmapnotify(xcb_unmap_notify_event_t *ev)
if((c = client_getbywin(ev->window)))
{
client_unmanage(c);
xcb_unmap_window(globalconf.connection, ev->window);
}
else
for(int i = 0; i < globalconf.embedded.len; i++)

View File

@ -1031,12 +1031,16 @@ client_unmanage(client_t *c)
ewmh_update_net_client_list(c->phys_screen);
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,
c->geometry.x, c->geometry.y);
xcb_destroy_window(globalconf.connection, c->frame_window);
/* Remove this window from the save set since this shouldn't be made visible
* after a restart anymore. */
xcb_change_save_set(globalconf.connection, XCB_SET_MODE_DELETE, c->window);
xcb_destroy_window(globalconf.connection, c->frame_window);
/* set client as invalid */
c->invalid = true;