commit a93c6aaa1c17085d63ca5ecacd2ab202fb3a768b
parent 242a06a3300b0739190078edfd5b82f40ceb7d0c
Author: Jan Christoph Ebersbach <jceb@e-jc.de>
Date: Sun, 31 Jul 2016 07:38:14 +0200
Update patch push
Diffstat:
2 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/dwm.suckless.org/patches/dwm-push-20160731-56a31dc.diff b/dwm.suckless.org/patches/dwm-push-20160731-56a31dc.diff
@@ -0,0 +1,75 @@
+URL: http://dwm.suckless.org/patches/push
+pushup and pushdown provide a way to move clients inside the clients list.
+
+Index: dwm/push.c
+===================================================================
+--- /dev/null
++++ dwm/push.c
+@@ -0,0 +1,67 @@
++Client *
++nextc(Client *c, float f) {
++ if(!f)
++ return nexttiled(c);
++
++ for(; c && !ISVISIBLE(c); c = c->next);
++ return c;
++}
++
++static Client *
++prevc(Client *c, float f) {
++ Client *p, *r;
++
++ for(p = selmon->clients, r = NULL; c && p && p != c; p = p->next)
++ if((f || !p->isfloating) && ISVISIBLE(p))
++ r = p;
++ return r;
++}
++
++static void
++pushup(const Arg *arg) {
++ Client *sel = selmon->sel;
++ Client *c;
++
++ if(!sel || (sel->isfloating && !arg->f))
++ return;
++ if((c = prevc(sel, arg->f))) {
++ /* attach before c */
++ detach(sel);
++ sel->next = c;
++ if(selmon->clients == c)
++ selmon->clients = sel;
++ else {
++ for(c = selmon->clients; c->next != sel->next; c = c->next);
++ c->next = sel;
++ }
++ } else {
++ /* move to the end */
++ for(c = sel; c->next; c = c->next);
++ detach(sel);
++ sel->next = NULL;
++ c->next = sel;
++ }
++ focus(sel);
++ arrange(selmon);
++}
++
++static void
++pushdown(const Arg *arg) {
++ Client *sel = selmon->sel;
++ Client *c;
++
++ if(!sel || (sel->isfloating && !arg->f))
++ return;
++ if((c = nextc(sel->next, arg->f))) {
++ /* attach after c */
++ detach(sel);
++ sel->next = c->next;
++ c->next = sel;
++ } else {
++ /* move to the front */
++ detach(sel);
++ attach(sel);
++ }
++ focus(sel);
++ arrange(selmon);
++}
diff --git a/dwm.suckless.org/patches/push.md b/dwm.suckless.org/patches/push.md
@@ -17,6 +17,7 @@
Patches against different versions of dwm are available at
[dwm-clean-patches](https://github.com/jceb/dwm-clean-patches).
+ * [dwm-push-20160731-56a31dc.diff](dwm-push-20160731-56a31dc.diff)
* [dwm-push-6.0.diff](dwm-push-6.0.diff) (1332b) - 2012/4/6
* [dwm-6.0-push_no_master.diff](dwm-6.0-push_no_master.diff)
* [dwm-push-6.1.diff](dwm-push-6.1.diff) (1402b) - 2014/2/9