dwm-flexipatch/patch/shiftview.c

19 lines
482 B
C
Raw Normal View History

2020-01-29 13:22:24 +00:00
void
shiftview(const Arg *arg)
{
Arg shifted;
#if SCRATCHPADS_PATCH
unsigned int seltagset = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
#else
unsigned int seltagset = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH
2020-05-03 14:09:05 +00:00
if (arg->i > 0) // left circular shift
shifted.ui = (seltagset << arg->i)
| (seltagset >> (NUMTAGS - arg->i));
2020-01-29 13:22:24 +00:00
else // right circular shift
shifted.ui = seltagset >> -arg->i
| seltagset << (NUMTAGS + arg->i);
2020-01-29 13:22:24 +00:00
view(&shifted);
2020-05-03 14:09:05 +00:00
}