summaryrefslogtreecommitdiffhomepage
path: root/patch/shiftview.c
blob: 7e1a7a0cc970dfa6db48e211d4d48ea2a68d750c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void
shiftview(const Arg *arg)
{
	Arg shifted;

	if(arg->i > 0) // left circular shift
		shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
		   | (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));

	else // right circular shift
		shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
		   | selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);

	view(&shifted);
}