only cycle through active tags
This commit is contained in:
parent
c765d2e678
commit
06cc0e0de9
1 changed files with 26 additions and 9 deletions
35
shiftview.c
35
shiftview.c
|
@ -4,16 +4,33 @@
|
||||||
* or left (negative value)
|
* or left (negative value)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
shiftview(const Arg *arg) {
|
shiftview(const Arg *arg)
|
||||||
Arg shifted;
|
{
|
||||||
|
Arg a;
|
||||||
|
Client *c;
|
||||||
|
unsigned visible = 0;
|
||||||
|
int i = arg->i;
|
||||||
|
int count = 0;
|
||||||
|
int nextseltags, curseltags = selmon->tagset[selmon->seltags];
|
||||||
|
|
||||||
if(arg->i > 0) // left circular shift
|
do {
|
||||||
shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
|
if(i > 0) // left circular shift
|
||||||
| (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));
|
nextseltags = (curseltags << i) | (curseltags >> (LENGTH(tags) - i));
|
||||||
|
|
||||||
else // right circular shift
|
else // right circular shift
|
||||||
shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
|
nextseltags = curseltags >> (- i) | (curseltags << (LENGTH(tags) + i));
|
||||||
| selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);
|
|
||||||
|
|
||||||
view(&shifted);
|
// Check if tag is visible
|
||||||
|
for (c = selmon->clients; c && !visible; c = c->next)
|
||||||
|
if (nextseltags & c->tags) {
|
||||||
|
visible = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i += arg->i;
|
||||||
|
} while (!visible && ++count < 10);
|
||||||
|
|
||||||
|
if (count < 10) {
|
||||||
|
a.i = nextseltags;
|
||||||
|
view(&a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue