diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c index e2711789..e92528b6 100644 --- a/cmd/wmii/client.c +++ b/cmd/wmii/client.c @@ -293,12 +293,16 @@ client_destroy(Client *c) { else reparentwindow(&c->w, &scr.root, r.min); + if(starting > -1) + XRemoveFromSaveSet(display, c->w.xid); + traperrors(false); XUngrabServer(display); none = nil; client_setviews(c, &none); - client_unmap(c, WithdrawnState); + if(starting > -1) + client_unmap(c, WithdrawnState); refree(&c->tagre); refree(&c->tagvre); free(c->retags); @@ -307,7 +311,8 @@ client_destroy(Client *c) { ewmh_destroyclient(c); group_remove(c); - event("DestroyClient %C\n", c); + if(starting > -1) + event("DestroyClient %C\n", c); flushevents(FocusChangeMask, true); free(c->w.hints); diff --git a/cmd/wmii/dat.h b/cmd/wmii/dat.h index 4fbcb506..77d7dda0 100644 --- a/cmd/wmii/dat.h +++ b/cmd/wmii/dat.h @@ -385,7 +385,7 @@ typedef void (*XHandler)(XEvent*); EXTERN XHandler handler[LASTEvent]; /* Misc */ -EXTERN bool starting; +EXTERN int starting; EXTERN bool resizing; EXTERN long ignoreenter; EXTERN char* user; diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c index 91095757..ffb50e87 100644 --- a/cmd/wmii/main.c +++ b/cmd/wmii/main.c @@ -225,6 +225,7 @@ init_screens(void) { static void cleanup(void) { + starting = -1; while(client) client_destroy(client); ixp_server_close(&srv);