A client_delete should behave differently depending on whether the

triggering event was unmap (with pending destroy) log destroy; we only
need to grab/ungrab the server lock, set WithdrawnState and
XRemoveFromSaveSet clients coming from an unmap event - doing so for
clients coming from destroy are already gone, hence we generate errors.
This commit is contained in:
okan
2013-10-25 19:46:16 +00:00
parent 6867821abe
commit 6e17b41f56
3 changed files with 12 additions and 10 deletions

View File

@@ -145,17 +145,19 @@ client_init(Window win, struct screen_ctx *sc, int mapped)
}
void
client_delete(struct client_ctx *cc)
client_delete(struct client_ctx *cc, int destroy)
{
struct screen_ctx *sc = cc->sc;
struct winname *wn;
XGrabServer(X_Dpy);
cc->state = WithdrawnState;
xu_set_wm_state(cc->win, cc->state);
XRemoveFromSaveSet(X_Dpy, cc->win);
XSync(X_Dpy, False);
XUngrabServer(X_Dpy);
if (destroy) {
XGrabServer(X_Dpy);
cc->state = WithdrawnState;
xu_set_wm_state(cc->win, cc->state);
XRemoveFromSaveSet(X_Dpy, cc->win);
XSync(X_Dpy, False);
XUngrabServer(X_Dpy);
}
TAILQ_REMOVE(&sc->mruq, cc, mru_entry);
TAILQ_REMOVE(&Clientq, cc, entry);