mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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:
16
client.c
16
client.c
@@ -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);
|
||||
|
Reference in New Issue
Block a user