shiftview + scrachpads compatibility

This commit is contained in:
Bakkeby 2022-05-08 21:43:57 +02:00
parent 2ecc15a2ef
commit c553f93b52
4 changed files with 15 additions and 22 deletions

View File

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

View File

@ -1,2 +1 @@
static void shiftview(const Arg *arg);

View File

@ -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 {
if (arg->i > 0) // left circular shift
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (NUMTAGS - arg->i));
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));
} 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));
}
view(&shifted);
}

View File

@ -1,2 +1 @@
static void shiftviewclients(const Arg *arg);