summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2014-09-10 20:30:38 +0000
committerokan <okan>2014-09-10 20:30:38 +0000
commitd27fc997848f2c48bbf3b18bab6de7cd1b2b8b5d (patch)
tree2ae683752b6df4f4c4a2986cfafd3cdb31d9b647
parent20c1113fdd58103b91af9d7b0a24fe575c208fc9 (diff)
downloadcwm-d27fc997848f2c48bbf3b18bab6de7cd1b2b8b5d.tar.gz
cwm-d27fc997848f2c48bbf3b18bab6de7cd1b2b8b5d.tar.xz
cwm-d27fc997848f2c48bbf3b18bab6de7cd1b2b8b5d.zip
fold in 'active' into 'flags'
-rw-r--r--calmwm.h2
-rw-r--r--client.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/calmwm.h b/calmwm.h
index 252ba3d..eda8904 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -180,12 +180,12 @@ struct client_ctx {
 #define CLIENT_URGENCY			0x0400
 #define CLIENT_FULLSCREEN		0x0800
 #define CLIENT_STICKY			0x1000
+#define CLIENT_ACTIVE			0x2000
 
 #define CLIENT_HIGHLIGHT		(CLIENT_GROUP | CLIENT_UNGROUP)
 #define CLIENT_MAXFLAGS			(CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
 #define CLIENT_MAXIMIZED		(CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
 	int			 flags;
-	int			 active;
 	int			 stackingorder;
 	struct winname_q	 nameq;
 #define CLIENT_MAXNAMEQLEN		5
diff --git a/client.c b/client.c
index 052280b..f1dfce5 100644
--- a/client.c
+++ b/client.c
@@ -195,7 +195,7 @@ client_setactive(struct client_ctx *cc)
 		client_msg(cc, cwmh[WM_TAKE_FOCUS], Last_Event_Time);
 
 	if ((oldcc = client_current())) {
-		oldcc->active = 0;
+		oldcc->flags &= ~CLIENT_ACTIVE;
 		client_draw_border(oldcc);
 	}
 
@@ -204,7 +204,7 @@ client_setactive(struct client_ctx *cc)
 		client_mtf(cc);
 
 	curcc = cc;
-	cc->active = 1;
+	cc->flags |= CLIENT_ACTIVE;
 	cc->flags &= ~CLIENT_URGENCY;
 	client_draw_border(cc);
 	conf_grab_mouse(cc->win);
@@ -485,7 +485,7 @@ client_hide(struct client_ctx *cc)
 
 	XUnmapWindow(X_Dpy, cc->win);
 
-	cc->active = 0;
+	cc->flags &= ~CLIENT_ACTIVE;
 	cc->flags |= CLIENT_HIDDEN;
 	client_set_wm_state(cc, IconicState);
 
@@ -509,7 +509,7 @@ client_unhide(struct client_ctx *cc)
 void
 client_urgency(struct client_ctx *cc)
 {
-	if (!cc->active)
+	if (!(cc->flags & CLIENT_ACTIVE))
 		cc->flags |= CLIENT_URGENCY;
 }
 
@@ -519,7 +519,7 @@ client_draw_border(struct client_ctx *cc)
 	struct screen_ctx	*sc = cc->sc;
 	unsigned long		 pixel;
 
-	if (cc->active)
+	if (cc->flags & CLIENT_ACTIVE)
 		switch (cc->flags & CLIENT_HIGHLIGHT) {
 		case CLIENT_GROUP:
 			pixel = sc->xftcolor[CWM_COLOR_BORDER_GROUP].pixel;