diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 17:51:34 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 17:51:34 +0100 |
| commit | 5a13632afb970ce78957f9f80c9d3a4e4b55d5d1 (patch) | |
| tree | ba33b0d7b6cc3ec49b8d269c8fd64537e207c974 | |
| parent | renamed versatile into untiled (diff) | |
| download | dwm-5a13632afb970ce78957f9f80c9d3a4e4b55d5d1.tar.gz dwm-5a13632afb970ce78957f9f80c9d3a4e4b55d5d1.zip | |
simplified focusclient()
Diffstat (limited to '')
| -rw-r--r-- | layout.c | 16 |
1 files changed, 6 insertions, 10 deletions
| @@ -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); |
