diff --git a/patch/shiftview.c b/patch/shiftview.c index c4494dc..72d5b36 100644 --- a/patch/shiftview.c +++ b/patch/shiftview.c @@ -2,14 +2,17 @@ void shiftview(const Arg *arg) { Arg shifted; - + #if SCRATCHPADS_PATCH + unsigned int seltagset = selmon->tagset[selmon->seltags] & ~SPTAGMASK; + #else + unsigned int seltagset = selmon->tagset[selmon->seltags]; + #endif // SCRATCHPADS_PATCH if (arg->i > 0) // left circular shift - shifted.ui = (selmon->tagset[selmon->seltags] << arg->i) - | (selmon->tagset[selmon->seltags] >> (NUMTAGS - arg->i)); - + shifted.ui = (seltagset << arg->i) + | (seltagset >> (NUMTAGS - arg->i)); else // right circular shift - shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i) - | selmon->tagset[selmon->seltags] << (NUMTAGS + arg->i); + shifted.ui = seltagset >> -arg->i + | seltagset << (NUMTAGS + arg->i); view(&shifted); }