summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-10-25 19:46:17 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-10-25 19:46:17 +0000
commit749e39e8a9145226d3dae2aa5876ed92c9fdf167 (patch)
tree64b8d94a563881efcc47013803846e4e7d80d1d5 /app/cwm
parent7b612f9706bf91820dfcfacfd1428f400fd0942b (diff)
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 'app/cwm')
-rw-r--r--app/cwm/calmwm.h4
-rw-r--r--app/cwm/client.c18
-rw-r--r--app/cwm/xevents.c6
3 files changed, 15 insertions, 13 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index 4bcd0fc56..226c30744 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -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: calmwm.h,v 1.223 2013/10/20 01:55:32 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.224 2013/10/25 19:46:16 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -373,7 +373,7 @@ struct client_ctx *client_current(void);
void client_cycle(struct screen_ctx *, int);
void client_cycle_leave(struct screen_ctx *,
struct client_ctx *);
-void client_delete(struct client_ctx *);
+void client_delete(struct client_ctx *, int);
void client_draw_border(struct client_ctx *);
struct client_ctx *client_find(Window);
void client_freeze(struct client_ctx *);
diff --git a/app/cwm/client.c b/app/cwm/client.c
index e802829fc..b3a64fc4e 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -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);
diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c
index 786ae0cd7..d92386bb5 100644
--- a/app/cwm/xevents.c
+++ b/app/cwm/xevents.c
@@ -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: xevents.c,v 1.90 2013/07/15 23:51:59 okan Exp $
+ * $OpenBSD: xevents.c,v 1.91 2013/10/25 19:46:16 okan Exp $
*/
/*
@@ -113,7 +113,7 @@ xev_handle_unmapnotify(XEvent *ee)
*/
if (XCheckTypedWindowEvent(X_Dpy, cc->win,
DestroyNotify, &ev) || e->send_event != 0) {
- client_delete(cc);
+ client_delete(cc, 1);
} else
client_hide(cc);
}
@@ -127,7 +127,7 @@ xev_handle_destroynotify(XEvent *ee)
struct client_ctx *cc;
if ((cc = client_find(e->window)) != NULL)
- client_delete(cc);
+ client_delete(cc, 0);
}
static void