Merge branch 'master' of github.com:LukeSmithxyz/dwm
This commit is contained in:
commit
e29effe9c3
1 changed files with 19 additions and 23 deletions
42
shiftview.c
42
shiftview.c
|
@ -6,33 +6,29 @@
|
||||||
void
|
void
|
||||||
shiftview(const Arg *arg)
|
shiftview(const Arg *arg)
|
||||||
{
|
{
|
||||||
Arg a;
|
Arg shifted;
|
||||||
Client *c;
|
Client *c;
|
||||||
unsigned visible = 0;
|
unsigned int tagmask = 0;
|
||||||
int i = arg->i;
|
|
||||||
int count = 0;
|
|
||||||
int nextseltags, curseltags = selmon->tagset[selmon->seltags];
|
|
||||||
|
|
||||||
|
for (c = selmon->clients; c; c = c->next)
|
||||||
|
if (!(c->tags & SPTAGMASK))
|
||||||
|
tagmask = tagmask | c->tags;
|
||||||
|
|
||||||
|
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
|
||||||
|
if (arg->i > 0) /* left circular shift */
|
||||||
do {
|
do {
|
||||||
if(i > 0) // left circular shift
|
shifted.ui = (shifted.ui << arg->i)
|
||||||
nextseltags = (curseltags << i) | (curseltags >> (LENGTH(tags) - i));
|
| (shifted.ui >> (LENGTH(tags) - arg->i));
|
||||||
|
shifted.ui &= ~SPTAGMASK;
|
||||||
|
} while (tagmask && !(shifted.ui & tagmask));
|
||||||
|
else /* right circular shift */
|
||||||
|
do {
|
||||||
|
shifted.ui = (shifted.ui >> (- arg->i)
|
||||||
|
| shifted.ui << (LENGTH(tags) + arg->i));
|
||||||
|
shifted.ui &= ~SPTAGMASK;
|
||||||
|
} while (tagmask && !(shifted.ui & tagmask));
|
||||||
|
|
||||||
else // right circular shift
|
view(&shifted);
|
||||||
nextseltags = curseltags >> (- i) | (curseltags << (LENGTH(tags) + i));
|
|
||||||
|
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue