Client * prevtiled(Client *c) { for(; c && (c->isfloating || !isvisible(c)); c = c->prev); return c; } void pushup(const char *arg) { Client *c; if(!sel || !dozoom || sel->isfloating) return; if((c = prevtiled(sel->prev))) { /* attach before c */ detach(sel); sel->next = c; sel->prev = c->prev; c->prev = sel; if(sel->prev) sel->prev->next = sel; else clients = sel; } else { /* move to the end */ for(c = sel; c->next; c = c->next); detach(sel); sel->prev = c; c->next = sel; } focus(sel); arrange(); } void pushdown(const char *arg) { Client *c; if(!sel || !dozoom || sel->isfloating) return; if((c = nexttiled(sel->next))) { /* attach after c */ detach(sel); sel->prev = c; sel->next = c->next; c->next = sel; if(sel->next) sel->next->prev = sel; } else { /* move to the front */ detach(sel); attach(sel); } focus(sel); arrange(); }