summaryrefslogtreecommitdiffhomepage
path: root/patch/shiftviewclients.c
diff options
context:
space:
mode:
Diffstat (limited to 'patch/shiftviewclients.c')
-rw-r--r--patch/shiftviewclients.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/patch/shiftviewclients.c b/patch/shiftviewclients.c
index 1bf9de8..b805b51 100644
--- a/patch/shiftviewclients.c
+++ b/patch/shiftviewclients.c
@@ -5,7 +5,11 @@ shiftviewclients(const Arg *arg)
Client *c;
unsigned int tagmask = 0;
- for (c = selmon->clients; c; c = c->next)
+ #if TAGSYNC_PATCH
+ Monitor *origselmon = selmon;
+ for (selmon = mons; selmon; selmon = selmon->next)
+ #endif // TAGSYNC_PATCH
+ for (c = selmon->clients; c; c = c->next) {
#if SCRATCHPADS_PATCH
if (!(c->tags & SPTAGMASK))
tagmask = tagmask | c->tags;
@@ -15,13 +19,17 @@ shiftviewclients(const Arg *arg)
#else
tagmask = tagmask | c->tags;
#endif // SCRATCHPADS_PATCH
+ }
+ #if TAGSYNC_PATCH
+ selmon = origselmon;
+ #endif // TAGSYNC_PATCH
#if SCRATCHPADS_PATCH
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
#else
shifted.ui = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH
- if (arg->i > 0) // left circular shift
+ if (arg->i > 0) { // left circular shift
do {
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (NUMTAGS - arg->i));
@@ -29,7 +37,7 @@ shiftviewclients(const Arg *arg)
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
} while (tagmask && !(shifted.ui & tagmask));
- else // right circular shift
+ } else { // right circular shift
do {
shifted.ui = (shifted.ui >> (- arg->i)
| shifted.ui << (NUMTAGS + arg->i));
@@ -37,6 +45,7 @@ shiftviewclients(const Arg *arg)
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
} while (tagmask && !(shifted.ui & tagmask));
+ }
view(&shifted);
}