summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 17:51:34 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 17:51:34 +0100
commit5a13632afb970ce78957f9f80c9d3a4e4b55d5d1 (patch)
treeba33b0d7b6cc3ec49b8d269c8fd64537e207c974
parentrenamed versatile into untiled (diff)
downloaddwm-5a13632afb970ce78957f9f80c9d3a4e4b55d5d1.tar.gz
dwm-5a13632afb970ce78957f9f80c9d3a4e4b55d5d1.zip
simplified focusclient()
-rw-r--r--layout.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/layout.c b/layout.c
index bb477d6..8756e00 100644
--- a/layout.c
+++ b/layout.c
@@ -75,21 +75,17 @@ focusclient(const char *arg) {
75 75
76 if(!sel || !arg) 76 if(!sel || !arg)
77 return; 77 return;
78 switch(atoi(arg)) { 78 if(atoi(arg) < 0) {
79 default:
80 return;
81 case 1:
82 for(c = sel->next; c && !isvisible(c); c = c->next);
83 if(!c)
84 for(c = clients; c && !isvisible(c); c = c->next);
85 break;
86 case -1:
87 for(c = sel->prev; c && !isvisible(c); c = c->prev); 79 for(c = sel->prev; c && !isvisible(c); c = c->prev);
88 if(!c) { 80 if(!c) {
89 for(c = clients; c && c->next; c = c->next); 81 for(c = clients; c && c->next; c = c->next);
90 for(; c && !isvisible(c); c = c->prev); 82 for(; c && !isvisible(c); c = c->prev);
91 } 83 }
92 break; 84 }
85 else {
86 for(c = sel->next; c && !isvisible(c); c = c->next);
87 if(!c)
88 for(c = clients; c && !isvisible(c); c = c->next);
93 } 89 }
94 if(c) { 90 if(c) {
95 focus(c); 91 focus(c);