diff options
author | okan | 2011-09-03 09:20:58 +0000 |
---|---|---|
committer | okan | 2011-09-03 09:20:58 +0000 |
commit | 396ab2c5818d5fb12d474bbb4caa43c1f3be7fc5 (patch) | |
tree | 63f9d24a3df9b6cadacfe8149ef56013c0f04914 /client.c | |
parent | d9975e05e840a450623ca41602c3636810d8b1ff (diff) | |
download | cwm-396ab2c5818d5fb12d474bbb4caa43c1f3be7fc5.tar.gz |
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 '')
-rw-r--r-- | client.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.86 2011/07/14 11:39:53 okan Exp $ + * $OpenBSD: client.c,v 1.87 2011/09/03 09:20:58 okan Exp $ */ #include <sys/param.h> @@ -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? */ |