summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2016-09-14 19:45:33 +0000
committerokan <okan>2016-09-14 19:45:33 +0000
commitb8933ebccaba603c47d15026ed22a2afabbd9d67 (patch)
treeb4000dffcac39e3ed97b4730c69f53675808ac33 /client.c
parent9124a561e317d68454ce22c65da47cff10482ce5 (diff)
downloadcwm-b8933ebccaba603c47d15026ed22a2afabbd9d67.tar.gz
cwm-b8933ebccaba603c47d15026ed22a2afabbd9d67.tar.xz
cwm-b8933ebccaba603c47d15026ed22a2afabbd9d67.zip
Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag
instead of relying on curcc.
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/client.c b/client.c
index d9c8241..b730c78 100644
--- a/client.c
+++ b/client.c
@@ -176,12 +176,12 @@ client_delete(struct client_ctx *cc)
 	xu_ewmh_net_client_list(sc);
 	xu_ewmh_net_client_list_stacking(sc);
 
+	if (cc->flags & CLIENT_ACTIVE)
+		client_none(sc);
+
 	if (cc->gc != NULL)
 		TAILQ_REMOVE(&cc->gc->clientq, cc, group_entry);
 
-	if (cc == client_current())
-		client_none(sc);
-
 	while ((wn = TAILQ_FIRST(&cc->nameq)) != NULL) {
 		TAILQ_REMOVE(&cc->nameq, wn, entry);
 		free(wn->name);
@@ -510,12 +510,12 @@ client_hide(struct client_ctx *cc)
 {
 	XUnmapWindow(X_Dpy, cc->win);
 
+	if (cc->flags & CLIENT_ACTIVE)
+		client_none(cc->sc);
+
 	cc->flags &= ~CLIENT_ACTIVE;
 	cc->flags |= CLIENT_HIDDEN;
 	client_set_wm_state(cc, IconicState);
-
-	if (cc == client_current())
-		client_none(cc->sc);
 }
 
 void