focusadjacenttags + scratchpad compatibility issue ref. #236

This commit is contained in:
bakkeby 2022-02-20 13:24:52 +01:00
parent 96820b2d51
commit 55592623f5

View File

@ -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 }));
}