dwm/patch/shiftview.c

19 lines
482 B
C
Raw Normal View History

2020-01-29 14:22:24 +01: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 16:09:05 +02:00
if (arg->i > 0) // left circular shift
shifted.ui = (seltagset << arg->i)
| (seltagset >> (NUMTAGS - arg->i));
2020-01-29 14:22:24 +01:00
else // right circular shift
shifted.ui = seltagset >> -arg->i
| seltagset << (NUMTAGS + arg->i);
2020-01-29 14:22:24 +01:00
view(&shifted);
2020-05-03 16:09:05 +02:00
}