summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
authorokan <okan>2016-10-18 17:03:30 +0000
committerokan <okan>2016-10-18 17:03:30 +0000
commit0bb1be86c69ea95103e1a6b38c093406a47cdb07 (patch)
treeb7aa2c4a5a2c09bb20637f0c50dd4c01377abda0 /group.c
parent38eac7d7e9d36243271eb7f968a3152c9eb0cfbc (diff)
downloadcwm-0bb1be86c69ea95103e1a6b38c093406a47cdb07.tar.gz
cwm-0bb1be86c69ea95103e1a6b38c093406a47cdb07.tar.xz
cwm-0bb1be86c69ea95103e1a6b38c093406a47cdb07.zip
Refactor callbacks to take a void * so as to not try and generalize into
client_ctx in keypress and buttonpress event handlers; pass appropriate *ctx's
based on context.

While here, limit some globals, replace defines with appropriate variables and
fix some naming.
Diffstat (limited to 'group.c')
-rw-r--r--group.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/group.c b/group.c
index 36fd397..ec368de 100644
--- a/group.c
+++ b/group.c
@@ -265,7 +265,7 @@ group_cycle(struct screen_ctx *sc, int flags)
 
 	newgc = oldgc;
 	for (;;) {
-		newgc = (flags & CWM_CLIENT_RCYCLE) ? group_prev(newgc) :
+		newgc = (flags & CWM_CYCLE_REVERSE) ? group_prev(newgc) :
 		    group_next(newgc);
 
 		if (newgc == oldgc)
@@ -304,8 +304,8 @@ group_prev(struct group_ctx *gc)
 	struct screen_ctx	*sc = gc->sc;
 	struct group_ctx	*newgc;
 
-	return(((newgc = TAILQ_PREV(gc, group_ctx_q, entry)) != NULL) ?
-	    newgc : TAILQ_LAST(&sc->groupq, group_ctx_q));
+	return(((newgc = TAILQ_PREV(gc, group_q, entry)) != NULL) ?
+	    newgc : TAILQ_LAST(&sc->groupq, group_q));
 }
 
 void
@@ -351,21 +351,21 @@ int
 group_autogroup(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = cc->sc;
-	struct autogroupwin	*aw;
+	struct autogroup	*ag;
 	struct group_ctx	*gc;
 	int			 num = -1, both_match = 0;
 
 	if (cc->ch.res_class == NULL || cc->ch.res_name == NULL)
 		return(0);
 
-	TAILQ_FOREACH(aw, &Conf.autogroupq, entry) {
-		if (strcmp(aw->class, cc->ch.res_class) == 0) {
-			if ((aw->name != NULL) &&
-			    (strcmp(aw->name, cc->ch.res_name) == 0)) {
-				num = aw->num;
+	TAILQ_FOREACH(ag, &Conf.autogroupq, entry) {
+		if (strcmp(ag->class, cc->ch.res_class) == 0) {
+			if ((ag->name != NULL) &&
+			    (strcmp(ag->name, cc->ch.res_name) == 0)) {
+				num = ag->num;
 				both_match = 1;
-			} else if (aw->name == NULL && !both_match)
-				num = aw->num;
+			} else if (ag->name == NULL && !both_match)
+				num = ag->num;
 		}
 	}