summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2011-09-03 09:20:58 +0000
committerokan <okan>2011-09-03 09:20:58 +0000
commit142a36a0c0448ef9c9f7eb36068d45dce09839a9 (patch)
tree9fd05aefefc79b1df19f0dd3acd5b34d88741d73 /client.c
parentb51f8e6a990c3462464b3830e51b54605e2ade6a (diff)
downloadcwm-142a36a0c0448ef9c9f7eb36068d45dce09839a9.tar.gz
cwm-142a36a0c0448ef9c9f7eb36068d45dce09839a9.tar.xz
cwm-142a36a0c0448ef9c9f7eb36068d45dce09839a9.zip
Add {r,}cycleingroup to cycle through clients belonging to the same
group as the active client (as opposed to all unhidden clients); from
Alexander Polakov, with a tiny tweak requested by oga.

ok oga@
Diffstat (limited to 'client.c')
-rw-r--r--client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/client.c b/client.c
index a55bd42..7a0fbc6 100644
--- a/client.c
+++ b/client.c
@@ -567,7 +567,7 @@ match:
 }
 
 void
-client_cycle(struct screen_ctx *sc, int reverse)
+client_cycle(struct screen_ctx *sc, int flags)
 {
 	struct client_ctx	*oldcc, *newcc;
 	int			 again = 1;
@@ -579,18 +579,19 @@ client_cycle(struct screen_ctx *sc, int reverse)
 		return;
 
 	if (oldcc == NULL)
-		oldcc = (reverse ? TAILQ_LAST(&sc->mruq, cycle_entry_q) :
+		oldcc = (flags & CWM_RCYCLE ? TAILQ_LAST(&sc->mruq, cycle_entry_q) :
 		    TAILQ_FIRST(&sc->mruq));
 
 	newcc = oldcc;
 	while (again) {
 		again = 0;
 
-		newcc = (reverse ? client_mruprev(newcc) :
+		newcc = (flags & CWM_RCYCLE ? client_mruprev(newcc) :
 		    client_mrunext(newcc));
 
 		/* Only cycle visible and non-ignored windows. */
-		if (newcc->flags & (CLIENT_HIDDEN|CLIENT_IGNORE))
+		if ((newcc->flags & (CLIENT_HIDDEN|CLIENT_IGNORE))
+			|| ((flags & CWM_INGROUP) && (newcc->group != oldcc->group)))
 			again = 1;
 
 		/* Is oldcc the only non-hidden window? */