diff -r 4cb4940d8355 -r f1ec35606dbc layout.c --- a/layout.c Thu Feb 22 15:06:56 2007 +0100 +++ b/layout.c Thu Feb 22 15:25:19 2007 +0100 @@ -70,30 +70,26 @@ /* extern */ void -focusnext(const char *arg) { +focusclient(const char *arg) { Client *c; - if(!sel) + if(!sel || !arg) + return; + switch(atoi(arg)) { + default: return; - 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(); - } -} - -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); + 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: + 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; } if(c) { focus(c);