X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=cmd.c;h=baa3ae94fabe163243c5042e7417643c27712fd3;hp=c14c3e60e86ecd3b0daeaebb68325abe943c18da;hb=dfd84f9bf3b9d949412a73bc62a43109b340d395;hpb=2a0fc84c4af2257d79c4c7cb37131c4acb763162 diff --git a/cmd.c b/cmd.c index c14c3e6..baa3ae9 100644 --- a/cmd.c +++ b/cmd.c @@ -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