diff --git a/event.c b/event.c index 200b78c92..fe605e2ab 100644 --- a/event.c +++ b/event.c @@ -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++) diff --git a/objects/client.c b/objects/client.c index 197214506..d4bb76006 100644 --- a/objects/client.c +++ b/objects/client.c @@ -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;