summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2011-09-13 08:37:49 +0000
committerokan <okan>2011-09-13 08:37:49 +0000
commitb96caa16e6a6406a0f837637cd5529f0d778b927 (patch)
treed29390858939efd1c22abbbae7ba78b92a6a144e
parent82d31aec1d380bc53a1ccfdabe81e37d9b7213c2 (diff)
downloadcwm-b96caa16e6a6406a0f837637cd5529f0d778b927.tar.gz
cwm-b96caa16e6a6406a0f837637cd5529f0d778b927.tar.xz
cwm-b96caa16e6a6406a0f837637cd5529f0d778b927.zip
repair groupcycle (broke after cycle-in-group support added more flags);
found by and fix from Thomas Pfaff.

ok oga@
-rw-r--r--group.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/group.c b/group.c
index e8d23e8..877a824 100644
--- a/group.c
+++ b/group.c
@@ -313,7 +313,7 @@ group_only(struct screen_ctx *sc, int idx)
  * Cycle through active groups.  If none exist, then just stay put.
  */
 void
-group_cycle(struct screen_ctx *sc, int reverse)
+group_cycle(struct screen_ctx *sc, int flags)
 {
 	struct group_ctx	*gc, *showgroup = NULL;
 
@@ -321,11 +321,11 @@ group_cycle(struct screen_ctx *sc, int reverse)
 
 	gc = sc->group_active;
 	for (;;) {
-		gc = reverse ? TAILQ_PREV(gc, group_ctx_q, entry) :
-		    TAILQ_NEXT(gc, entry);
+		gc = (flags & CWM_RCYCLE) ? TAILQ_PREV(gc, group_ctx_q,
+		    entry) : TAILQ_NEXT(gc, entry);
 		if (gc == NULL)
-			gc = reverse ? TAILQ_LAST(&sc->groupq, group_ctx_q) :
-			    TAILQ_FIRST(&sc->groupq);
+			gc = (flags & CWM_RCYCLE) ? TAILQ_LAST(&sc->groupq,
+			    group_ctx_q) : TAILQ_FIRST(&sc->groupq);
 		if (gc == sc->group_active)
 			break;