1 URL: http://dwm.suckless.org/patches/push
2 pushup and pushdown provide a way to move clients inside the clients list.
5 ===================================================================
10 +nextc(Client *c, float f) {
12 + return nexttiled(c);
14 + for(; c && !ISVISIBLE(c); c = c->next);
19 +prevc(Client *c, float f) {
22 + for(p = selmon->clients, r = NULL; c && p && p != c; p = p->next)
23 + if((f || !p->isfloating) && ISVISIBLE(p))
29 +pushup(const Arg *arg) {
30 + Client *sel = selmon->sel;
33 + if(!sel || (sel->isfloating && !arg->f))
35 + if((c = prevc(sel, arg->f))) {
36 + /* attach before c */
39 + if(selmon->clients == c)
40 + selmon->clients = sel;
42 + for(c = selmon->clients; c->next != sel->next; c = c->next);
46 + /* move to the end */
47 + for(c = sel; c->next; c = c->next);
57 +pushdown(const Arg *arg) {
58 + Client *sel = selmon->sel;
61 + if(!sel || (sel->isfloating && !arg->f))
63 + if((c = nextc(sel->next, arg->f))) {
64 + /* attach after c */
66 + sel->next = c->next;
69 + /* move to the front */