2020-05-05 19:54:02 +02:00
|
|
|
void
|
|
|
|
shiftviewclients(const Arg *arg)
|
|
|
|
{
|
|
|
|
Arg shifted;
|
|
|
|
Client *c;
|
|
|
|
unsigned int tagmask = 0;
|
|
|
|
|
|
|
|
for (c = selmon->clients; c; c = c->next)
|
2020-06-05 11:24:07 +02: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 19:54:02 +02:00
|
|
|
tagmask = tagmask | c->tags;
|
2020-06-05 11:24:07 +02:00
|
|
|
#endif // SCRATCHPADS_PATCH
|
2020-05-05 19:54:02 +02:00
|
|
|
|
|
|
|
shifted.ui = selmon->tagset[selmon->seltags];
|
|
|
|
if (arg->i > 0) // left circular shift
|
|
|
|
do {
|
|
|
|
shifted.ui = (shifted.ui << arg->i)
|
|
|
|
| (shifted.ui >> (LENGTH(tags) - arg->i));
|
|
|
|
} while (tagmask && !(shifted.ui & tagmask));
|
|
|
|
else // right circular shift
|
|
|
|
do {
|
|
|
|
shifted.ui = (shifted.ui >> (- arg->i)
|
|
|
|
| shifted.ui << (LENGTH(tags) + arg->i));
|
|
|
|
} while (tagmask && !(shifted.ui & tagmask));
|
|
|
|
|
|
|
|
view(&shifted);
|
|
|
|
}
|