- if(!strncmp(arg, "next", 5))
- c = stack->snext ? stack->snext : stack;
- else if(!strncmp(arg, "prev", 5))
- for(c = stack; c && c->snext; c = c->snext);
- if(!c)
- c = stack;
- craise(c);
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
- focus(c);
+
+ if(!(c = prev(csel)))
+ c = prev(cend);
+ if(c) {
+ craise(c);
+ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
+ focus(c);
+ }
+}
+
+void
+nextc(Arg *arg)
+{
+ Client *c;
+
+ if(!csel)
+ return;
+
+ if(!(c = next(csel)))
+ c = next(cstart);
+
+ if(c) {
+ craise(c);
+ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
+ focus(c);
+ }