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:
9
client.c
9
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? */
|
||||
|
||||
Reference in New Issue
Block a user