simplified focusclient()
This commit is contained in:
parent
587100873a
commit
5a13632afb
16
layout.c
16
layout.c
|
@ -75,21 +75,17 @@ focusclient(const char *arg) {
|
||||||
|
|
||||||
if(!sel || !arg)
|
if(!sel || !arg)
|
||||||
return;
|
return;
|
||||||
switch(atoi(arg)) {
|
if(atoi(arg) < 0) {
|
||||||
default:
|
|
||||||
return;
|
|
||||||
case 1:
|
|
||||||
for(c = sel->next; c && !isvisible(c); c = c->next);
|
|
||||||
if(!c)
|
|
||||||
for(c = clients; c && !isvisible(c); c = c->next);
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
||||||
if(!c) {
|
if(!c) {
|
||||||
for(c = clients; c && c->next; c = c->next);
|
for(c = clients; c && c->next; c = c->next);
|
||||||
for(; c && !isvisible(c); c = c->prev);
|
for(; c && !isvisible(c); c = c->prev);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
else {
|
||||||
|
for(c = sel->next; c && !isvisible(c); c = c->next);
|
||||||
|
if(!c)
|
||||||
|
for(c = clients; c && !isvisible(c); c = c->next);
|
||||||
}
|
}
|
||||||
if(c) {
|
if(c) {
|
||||||
focus(c);
|
focus(c);
|
||||||
|
|
Loading…
Reference in New Issue