2020-05-05 17:54:02 +00:00
|
|
|
void
|
|
|
|
shiftviewclients(const Arg *arg)
|
|
|
|
{
|
|
|
|
Arg shifted;
|
|
|
|
Client *c;
|
|
|
|
unsigned int tagmask = 0;
|
|
|
|
|
2022-02-11 15:57:53 +00:00
|
|
|
#if TAGSYNC_PATCH
|
|
|
|
Monitor *origselmon = selmon;
|
|
|
|
for (selmon = mons; selmon; selmon = selmon->next)
|
|
|
|
#endif // TAGSYNC_PATCH
|
|
|
|
for (c = selmon->clients; c; c = c->next) {
|
2020-06-05 09:24:07 +00:00
|
|
|
#if SCRATCHPADS_PATCH
|
|
|
|
if (!(c->tags & SPTAGMASK))
|
|
|
|
tagmask = tagmask | c->tags;
|
|
|
|
#elif SCRATCHPAD_ALT_1_PATCH
|
|
|
|
if (!(c->tags & SCRATCHPAD_MASK))
|
|
|
|
tagmask = tagmask | c->tags;
|
|
|
|
#else
|
2020-05-05 17:54:02 +00:00
|
|
|
tagmask = tagmask | c->tags;
|
2020-06-05 09:24:07 +00:00
|
|
|
#endif // SCRATCHPADS_PATCH
|
2022-02-11 15:57:53 +00:00
|
|
|
}
|
|
|
|
#if TAGSYNC_PATCH
|
|
|
|
selmon = origselmon;
|
|
|
|
#endif // TAGSYNC_PATCH
|
2020-05-05 17:54:02 +00:00
|
|
|
|
2020-10-04 09:36:51 +00:00
|
|
|
#if SCRATCHPADS_PATCH
|
|
|
|
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
|
|
|
|
#else
|
2020-05-05 17:54:02 +00:00
|
|
|
shifted.ui = selmon->tagset[selmon->seltags];
|
2020-10-04 09:36:51 +00:00
|
|
|
#endif // SCRATCHPADS_PATCH
|
2022-02-11 15:57:53 +00:00
|
|
|
if (arg->i > 0) { // left circular shift
|
2020-05-05 17:54:02 +00:00
|
|
|
do {
|
|
|
|
shifted.ui = (shifted.ui << arg->i)
|
2020-08-25 14:27:14 +00:00
|
|
|
| (shifted.ui >> (NUMTAGS - arg->i));
|
2020-10-29 13:23:58 +00:00
|
|
|
#if SCRATCHPADS_PATCH
|
|
|
|
shifted.ui &= ~SPTAGMASK;
|
|
|
|
#endif // SCRATCHPADS_PATCH
|
2020-05-05 17:54:02 +00:00
|
|
|
} while (tagmask && !(shifted.ui & tagmask));
|
2022-02-11 15:57:53 +00:00
|
|
|
} else { // right circular shift
|
2020-05-05 17:54:02 +00:00
|
|
|
do {
|
|
|
|
shifted.ui = (shifted.ui >> (- arg->i)
|
2020-08-25 14:27:14 +00:00
|
|
|
| shifted.ui << (NUMTAGS + arg->i));
|
2020-10-29 13:23:58 +00:00
|
|
|
#if SCRATCHPADS_PATCH
|
|
|
|
shifted.ui &= ~SPTAGMASK;
|
|
|
|
#endif // SCRATCHPADS_PATCH
|
2020-05-05 17:54:02 +00:00
|
|
|
} while (tagmask && !(shifted.ui & tagmask));
|
2022-02-11 15:57:53 +00:00
|
|
|
}
|
2020-05-05 17:54:02 +00:00
|
|
|
|
|
|
|
view(&shifted);
|
2021-06-14 05:16:17 +00:00
|
|
|
}
|
|
|
|
|