Xinqi Bao's Git
projects
/
dwm.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
5871008
)
simplified focusclient()
author
Anselm R. Garbe <
[email protected]
>
Thu, 22 Feb 2007 16:51:34 +0000
(17:51 +0100)
committer
Anselm R. Garbe <
[email protected]
>
Thu, 22 Feb 2007 16:51:34 +0000
(17:51 +0100)
layout.c
diff
|
blob
|
history
diff --git
a/layout.c
b/layout.c
index
bb477d6
..
8756e00
100644
(file)
--- a/
layout.c
+++ b/
layout.c
@@
-75,21
+75,17
@@
focusclient(const char *arg) {
if(!sel || !arg)
return;
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);
}
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);
}
if(c) {
focus(c);