diff options
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -23,16 +23,18 @@ void sel(void *aux) { const char *arg = aux; - Client *c; + Client *c = NULL; if(!arg || !stack) return; if(!strncmp(arg, "next", 5)) - focus(stack->snext ? stack->snext : stack); - else if(!strncmp(arg, "prev", 5)) { + c = stack->snext ? stack->snext : stack; + else if(!strncmp(arg, "prev", 5)) for(c = stack; c && c->snext; c = c->snext); - focus(c ? c : stack); - } + if(!c) + c = stack; + raise(c); + focus(c); } void |