aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index a477d6f..bfb7ba2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2596,12 +2596,12 @@ void
shiftboth(const Arg *arg)
{
Arg shifted;
- shifted.ui = selmon->tagset[selmon->seltags];
+ shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
if (arg->i > 0) /* left circular shift */
- shifted.ui = ((shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i)));
+ shifted.ui = ((shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i))) & ~SPTAGMASK;
else /* right circular shift */
- shifted.ui = ((shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i)));
+ shifted.ui = ((shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i))) & ~SPTAGMASK;
tag(&shifted);
view(&shifted);
}
@@ -2610,12 +2610,15 @@ void
shiftview(const Arg *arg)
{
Arg shifted;
- shifted.ui = selmon->tagset[selmon->seltags];
+ shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
- if (arg->i > 0) /* left circular shift */
+ if (arg->i > 0) {/* left circular shift */
shifted.ui = (shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i));
- else /* right circular shift */
+ shifted.ui &= ~SPTAGMASK;
+ } else { /* right circular shift */
shifted.ui = (shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i));
+ shifted.ui &= ~SPTAGMASK;
+ }
view(&shifted);
}