summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 15:25:19 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 15:25:19 +0100
commit27b0595af72060d7cc406639b6c53a854f0a3590 (patch)
treead04556f3a70e67d2a2db1e159d1fccf75cf7e37 /layout.c
parentmade dwm.h more tidy (thx Jukka for the zoom() hint) (diff)
downloaddwm-27b0595af72060d7cc406639b6c53a854f0a3590.tar.gz
dwm-27b0595af72060d7cc406639b6c53a854f0a3590.zip
merged focus{prev.next} into focusclient(1/-1)
Diffstat (limited to '')
-rw-r--r--layout.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/layout.c b/layout.c
index 5d43187..1e8f113 100644
--- a/layout.c
+++ b/layout.c
@@ -70,30 +70,26 @@ LAYOUTS
70/* extern */ 70/* extern */
71 71
72void 72void
73focusnext(const char *arg) { 73focusclient(const char *arg) {
74 Client *c; 74 Client *c;
75 75
76 if(!sel) 76 if(!sel || !arg)
77 return; 77 return;
78 for(c = sel->next; c && !isvisible(c); c = c->next); 78 switch(atoi(arg)) {
79 if(!c) 79 default:
80 for(c = clients; c && !isvisible(c); c = c->next);
81 if(c) {
82 focus(c);
83 restack();
84 }
85}
86
87void
88focusprev(const char *arg) {
89 Client *c;
90
91 if(!sel)
92 return; 80 return;
93 for(c = sel->prev; c && !isvisible(c); c = c->prev); 81 case 1:
94 if(!c) { 82 for(c = sel->next; c && !isvisible(c); c = c->next);
95 for(c = clients; c && c->next; c = c->next); 83 if(!c)
96 for(; c && !isvisible(c); c = c->prev); 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);
88 if(!c) {
89 for(c = clients; c && c->next; c = c->next);
90 for(; c && !isvisible(c); c = c->prev);
91 }
92 break;
97 } 93 }
98 if(c) { 94 if(c) {
99 focus(c); 95 focus(c);