summaryrefslogtreecommitdiff
path: root/patch/shiftview.c
diff options
context:
space:
mode:
authorBear <bear@bengtsson.win>2021-12-27 09:29:58 +0000
committerBear <bear@bengtsson.win>2021-12-27 09:29:58 +0000
commit69262b01ced79c2d776fab9b889926d1816a1e7a (patch)
treef304cd6fa8734e83a7772d07dc9b484781565155 /patch/shiftview.c
Added DWM
Diffstat (limited to 'patch/shiftview.c')
-rw-r--r--patch/shiftview.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/patch/shiftview.c b/patch/shiftview.c
new file mode 100644
index 0000000..423d74b
--- /dev/null
+++ b/patch/shiftview.c
@@ -0,0 +1,19 @@
+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 = (seltagset << arg->i)
+ | (seltagset >> (NUMTAGS - arg->i));
+ else // right circular shift
+ shifted.ui = seltagset >> -arg->i
+ | seltagset << (NUMTAGS + arg->i);
+
+ view(&shifted);
+}
+