diff options
Diffstat (limited to 'layout.c')
| -rw-r--r-- | layout.c | 36 |
1 files changed, 16 insertions, 20 deletions
| @@ -70,30 +70,26 @@ LAYOUTS | |||
| 70 | /* extern */ | 70 | /* extern */ |
| 71 | 71 | ||
| 72 | void | 72 | void |
| 73 | focusnext(const char *arg) { | 73 | focusclient(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 | |||
| 87 | void | ||
| 88 | focusprev(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); |
