summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorBakkeby <[email protected]>2022-05-08 21:43:57 +0200
committerBakkeby <[email protected]>2022-05-08 21:43:57 +0200
commitc553f93b528449ed2e7d4b424f063ef3c1d3d8f6 (patch)
tree8b9ef0a384c69d6a2e11a304050ea86dc74c9ce4 /patch
parent2ecc15a2ef8ab45d49cbf261cb3280fe9ab3d058 (diff)
downloaddwm-flexipatch-c553f93b528449ed2e7d4b424f063ef3c1d3d8f6.tar.gz
dwm-flexipatch-c553f93b528449ed2e7d4b424f063ef3c1d3d8f6.zip
shiftview + scrachpads compatibility
Diffstat (limited to 'patch')
-rw-r--r--patch/shiftview.c10
-rw-r--r--patch/shiftview.h1
-rw-r--r--patch/shiftviewclients.c25
-rw-r--r--patch/shiftviewclients.h1
4 files changed, 15 insertions, 22 deletions
diff --git a/patch/shiftview.c b/patch/shiftview.c
index 423d74b..b9c811a 100644
--- a/patch/shiftview.c
+++ b/patch/shiftview.c
@@ -8,12 +8,12 @@ shiftview(const Arg *arg)
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));
+ shifted.ui = (seltagset << arg->i) | (seltagset >> (NUMTAGS - arg->i));
else // right circular shift
- shifted.ui = seltagset >> -arg->i
- | seltagset << (NUMTAGS + arg->i);
+ shifted.ui = (seltagset >> -arg->i) | (seltagset << (NUMTAGS + arg->i));
+ #if SCRATCHPADS_PATCH
+ shifted.ui &= ~SPTAGMASK;
+ #endif // SCRATCHPADS_PATCH
view(&shifted);
}
-
diff --git a/patch/shiftview.h b/patch/shiftview.h
index 1d7fd1f..7bf3a14 100644
--- a/patch/shiftview.h
+++ b/patch/shiftview.h
@@ -1,2 +1 @@
static void shiftview(const Arg *arg);
-
diff --git a/patch/shiftviewclients.c b/patch/shiftviewclients.c
index b805b51..adeaab7 100644
--- a/patch/shiftviewclients.c
+++ b/patch/shiftviewclients.c
@@ -29,23 +29,18 @@ shiftviewclients(const Arg *arg)
#else
shifted.ui = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH
- if (arg->i > 0) { // left circular shift
- do {
+
+ do {
+ if (arg->i > 0) // left circular shift
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (NUMTAGS - arg->i));
- #if SCRATCHPADS_PATCH
- shifted.ui &= ~SPTAGMASK;
- #endif // SCRATCHPADS_PATCH
- } while (tagmask && !(shifted.ui & tagmask));
- } else { // right circular shift
- do {
- shifted.ui = (shifted.ui >> (- arg->i)
- | shifted.ui << (NUMTAGS + arg->i));
- #if SCRATCHPADS_PATCH
- shifted.ui &= ~SPTAGMASK;
- #endif // SCRATCHPADS_PATCH
- } while (tagmask && !(shifted.ui & tagmask));
- }
+ else // right circular shift
+ shifted.ui = (shifted.ui >> -arg->i)
+ | (shifted.ui << (NUMTAGS + arg->i));
+ #if SCRATCHPADS_PATCH
+ shifted.ui &= ~SPTAGMASK;
+ #endif // SCRATCHPADS_PATCH
+ } while (tagmask && !(shifted.ui & tagmask));
view(&shifted);
}
diff --git a/patch/shiftviewclients.h b/patch/shiftviewclients.h
index 49aeb51..2f652cd 100644
--- a/patch/shiftviewclients.h
+++ b/patch/shiftviewclients.h
@@ -1,2 +1 @@
static void shiftviewclients(const Arg *arg);
-