summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-10-04 11:45:44 +0200
committerbakkeby <[email protected]>2020-10-04 11:46:23 +0200
commit45f763b837c3d28dfdd6123207d553ea6f6cd3e6 (patch)
tree9cdd19b6570c656d57ad6a123ab3ca4335a36803
parent3b5f3f66cebb410720eb137c2178889e43a1fd0a (diff)
downloaddwm-flexipatch-45f763b837c3d28dfdd6123207d553ea6f6cd3e6.tar.gz
dwm-flexipatch-45f763b837c3d28dfdd6123207d553ea6f6cd3e6.zip
shiftview: fixed bug when scratchpad is enabled
-rw-r--r--patch/shiftview.c15
1 files changed, 9 insertions, 6 deletions
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);
}