mirror of
https://github.com/bakkeby/dwm-flexipatch
synced 2024-11-18 21:28:09 +00:00
24 lines
593 B
C
24 lines
593 B
C
void
|
|
shiftviewclients(const Arg *arg)
|
|
{
|
|
Arg shifted;
|
|
Client *c;
|
|
unsigned int tagmask = 0;
|
|
|
|
for (c = selmon->clients; c; c = c->next)
|
|
tagmask = tagmask | c->tags;
|
|
|
|
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);
|
|
} |