diff options
author | okan | 2013-10-25 19:46:16 +0000 |
---|---|---|
committer | okan | 2013-10-25 19:46:16 +0000 |
commit | db6a72259f627ccc7d656002c79d9420be7dfc3a (patch) | |
tree | a102d329073b05c6fb3eb770b02553c4bec1c493 /client.c | |
parent | 53bfa97286bc3ed63cc17f5ec3b8fee925316ce1 (diff) | |
download | cwm-db6a72259f627ccc7d656002c79d9420be7dfc3a.tar.gz |
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.
Diffstat (limited to '')
-rw-r--r-- | client.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.141 2013/10/20 01:35:47 okan Exp $ + * $OpenBSD: client.c,v 1.142 2013/10/25 19:46:16 okan Exp $ */ #include <sys/param.h> @@ -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); |