diff options
| author | bakkeby <[email protected]> | 2022-02-20 13:24:52 +0100 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2022-02-20 13:24:52 +0100 |
| commit | 55592623f585246b106bf5c4f075122d07ec7070 (patch) | |
| tree | 7b114d7b1f837322e9b22fd3cb87a1d10123971e | |
| parent | 96820b2d51b7e1bca5ccdd9ce289e9fd278aa767 (diff) | |
| download | dwm-flexipatch-55592623f585246b106bf5c4f075122d07ec7070.tar.gz dwm-flexipatch-55592623f585246b106bf5c4f075122d07ec7070.zip | |
focusadjacenttags + scratchpad compatibility issue ref. #236
| -rw-r--r-- | patch/focusadjacenttag.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/patch/focusadjacenttag.c b/patch/focusadjacenttag.c index b311b74..67dd768 100644 --- a/patch/focusadjacenttag.c +++ b/patch/focusadjacenttag.c @@ -1,8 +1,9 @@ void tagtoleft(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { selmon->sel->tags >>= 1; focus(NULL); @@ -13,9 +14,10 @@ tagtoleft(const Arg *arg) void tagtoright(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 - && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 + && selmon->tagset[selmon->seltags] & (MASK >> 1)) { selmon->sel->tags <<= 1; focus(NULL); arrange(selmon); @@ -25,7 +27,8 @@ tagtoright(const Arg *arg) void viewtoleft(const Arg *arg) { - if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + unsigned int MASK = (1 << NUMTAGS) - 1; + if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 })); } @@ -34,8 +37,9 @@ viewtoleft(const Arg *arg) void viewtoright(const Arg *arg) { - if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 - && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + unsigned int MASK = (1 << NUMTAGS) - 1; + if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 + && selmon->tagset[selmon->seltags] & (MASK >> 1)) { view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 })); } } @@ -43,8 +47,9 @@ viewtoright(const Arg *arg) void tagandviewtoleft(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { selmon->sel->tags >>= 1; view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 })); @@ -54,9 +59,10 @@ tagandviewtoleft(const Arg *arg) void tagandviewtoright(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 - && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 + && selmon->tagset[selmon->seltags] & (MASK >> 1)) { selmon->sel->tags <<= 1; view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 })); } |
