aboutsummarylogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorAnselm R. Garbe2007-02-22 17:51:34 +0100
committerAnselm R. Garbe2007-02-22 17:51:34 +0100
commitbc0f27cedf620bd72ded6dca9d34aca84127ac97 (patch)
tree13a333d9c2b5a3c666b5cd40426592df6e3ef8cc /layout.c
parent91bf78e2b78f965501afbc3d008bfd5cd6b3f4f4 (diff)
downloadaur-bc0f27cedf620bd72ded6dca9d34aca84127ac97.tar.gz
simplified focusclient()
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/layout.c b/layout.c
index bb477d64c944..8756e0018c8a 100644
--- a/layout.c
+++ b/layout.c
@@ -75,21 +75,17 @@ focusclient(const char *arg) {
if(!sel || !arg)
return;
- switch(atoi(arg)) {
- 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:
+ if(atoi(arg) < 0) {
for(c = sel->prev; c && !isvisible(c); c = c->prev);
if(!c) {
for(c = clients; c && c->next; c = c->next);
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) {
focus(c);