diff options
-rw-r--r-- | dwm.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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); } |