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@
This commit is contained in:
okan
2011-09-03 09:20:58 +00:00
parent b51f8e6a99
commit 142a36a0c0
4 changed files with 15 additions and 7 deletions

View File

@@ -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? */