dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

push_no_master.c (752B)


      1 Client *
      2 prevt(Client *c)
      3 {
      4 	Client *p, *r;
      5 
      6 	for (p = selmon->clients, r = NULL; p && p != c; p = p->next)
      7 		if (!p->isfloating && ISVISIBLE(p))
      8 			r = p;
      9 	return r;
     10 }
     11 
     12 void
     13 pushup(const Arg *arg)
     14 {
     15 	Client *sel = selmon->sel, *c;
     16 
     17 	if (!sel || sel->isfloating)
     18 		return;
     19 	if ((c = prevt(sel)) && c != nexttiled(selmon->clients)) {
     20 		detach(sel);
     21 		sel->next = c;
     22 		for (c = selmon->clients; c->next != sel->next; c = c->next);
     23 		c->next = sel;
     24 	}
     25 	focus(sel);
     26 	arrange(selmon);
     27 }
     28 
     29 void
     30 pushdown(const Arg *arg)
     31 {
     32 	Client *sel = selmon->sel, *c;
     33 
     34 	if (!sel || sel->isfloating || sel == nexttiled(selmon->clients))
     35 		return;
     36 	if ((c = nexttiled(sel->next))) {
     37 		detach(sel);
     38 		sel->next = c->next;
     39 		c->next = sel;
     40 	}
     41 	focus(sel);
     42 	arrange(selmon);
     43 }
     44