focusadjacenttag: adding pertag compatibiltiy ref. #152

This commit is contained in:
bakkeby 2021-05-28 14:33:56 +02:00
parent 9072ef28a4
commit 75b0c4f86b

View File

@ -28,7 +28,11 @@ viewtoleft(const Arg *arg)
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] > 1) { && selmon->tagset[selmon->seltags] > 1) {
selmon->seltags ^= 1; /* toggle sel tagset */ selmon->seltags ^= 1; /* toggle sel tagset */
#if PERTAG_PATCH
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] >> 1 }));
#else
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1; selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
#endif // pertagview
focus(NULL); focus(NULL);
arrange(selmon); arrange(selmon);
} }
@ -40,7 +44,11 @@ viewtoright(const Arg *arg)
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
selmon->seltags ^= 1; /* toggle sel tagset */ selmon->seltags ^= 1; /* toggle sel tagset */
#if PERTAG_PATCH
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] << 1 }));
#else
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1; selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
#endif // pertagview
focus(NULL); focus(NULL);
arrange(selmon); arrange(selmon);
} }
@ -53,7 +61,11 @@ tagandviewtoleft(const Arg *arg)
&& selmon->tagset[selmon->seltags] > 1) { && selmon->tagset[selmon->seltags] > 1) {
selmon->sel->tags >>= 1; selmon->sel->tags >>= 1;
selmon->seltags ^= 1; /* toggle sel tagset */ selmon->seltags ^= 1; /* toggle sel tagset */
#if PERTAG_PATCH
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] >> 1 }));
#else
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1; selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
#endif // pertagview
focus(selmon->sel); focus(selmon->sel);
arrange(selmon); arrange(selmon);
} }
@ -66,7 +78,11 @@ tagandviewtoright(const Arg *arg)
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
selmon->sel->tags <<= 1; selmon->sel->tags <<= 1;
selmon->seltags ^= 1; /* toggle sel tagset */ selmon->seltags ^= 1; /* toggle sel tagset */
#if PERTAG_PATCH
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] << 1 }));
#else
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1; selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
#endif // pertagview
focus(selmon->sel); focus(selmon->sel);
arrange(selmon); arrange(selmon);
} }