diff options
author | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-16 17:55:55 +0200 |
---|---|---|
committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-16 17:55:55 +0200 |
commit | 10bc0ce912eb99fec49d954c80d92e04429ed0ee (patch) | |
tree | 524951e34fcd67e59b672c4ae203b71f94a214b3 /layout.c | |
parent | e8792d95a12c85f9e660e192cd2c6260a01a3c5e (diff) | |
download | dwm-10bc0ce912eb99fec49d954c80d92e04429ed0ee.tar.gz |
made tag/view/toggle{tag,view} work on pointer to tags-array, there was the need to define Key key[] not static to do this. split focusclient into focusnext/prev, fixed config.*.h's
Diffstat (limited to 'layout.c')
-rw-r--r-- | layout.c | 34 |
1 files changed, 21 insertions, 13 deletions
@@ -42,22 +42,30 @@ arrange(void) { } void -focusclient(const char *arg) { +focusnext(const char *arg) { Client *c; - - if(!sel || !arg) + + if(!sel) return; - 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->next; c && !isvisible(c); c = c->next); + if(!c) + for(c = clients; c && !isvisible(c); c = c->next); + if(c) { + focus(c); + restack(); } - else { - for(c = sel->next; c && !isvisible(c); c = c->next); - if(!c) - for(c = clients; c && !isvisible(c); c = c->next); +} + +void +focusprev(const char *arg) { + Client *c; + + if(!sel) + return; + 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); } if(c) { focus(c); |