commit f7a4b3bc13049483885e38301423f2652eca95f7
parent 6e45ab18fe0e524ff29b51b83f25d05132194c17
Author: nsz <nszabolcs@gmail.com>
Date: Thu, 9 Jul 2009 21:32:16 +0200
push-5.6
Diffstat:
2 files changed, 63 insertions(+), 4 deletions(-)
diff --git a/dwm.suckless.org/patches/push-5.6.c b/dwm.suckless.org/patches/push-5.6.c
@@ -0,0 +1,58 @@
+static Client *
+prevtiled(Client *c) {
+ Client *p, *r;
+
+ for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
+ if(!p->isfloating && ISVISIBLE(p))
+ r = p;
+ return r;
+}
+
+static void
+pushup(const Arg *arg) {
+ Client *sel = selmon->sel;
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = prevtiled(sel))) {
+ /* 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();
+}
+
+static void
+pushdown(const Arg *arg) {
+ Client *sel = selmon->sel;
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = nexttiled(sel->next))) {
+ /* attach after c */
+ detach(sel);
+ sel->next = c->next;
+ c->next = sel;
+ } else {
+ /* move to the front */
+ detach(sel);
+ attach(sel);
+ }
+ focus(sel);
+ arrange();
+}
diff --git a/dwm.suckless.org/patches/push.md b/dwm.suckless.org/patches/push.md
@@ -4,12 +4,13 @@
This patch provides a way to move clients position inside the clients list.
- #include "push-5.3.c"
+ #include "push-5.6.c"
- { MODKEY|ControlMask, XK_j, pushdown, NULL }, \
- { MODKEY|ControlMask, XK_k, pushup, NULL }, \
+ { MODKEY|ControlMask, XK_j, pushdown, NULL },
+ { MODKEY|ControlMask, XK_k, pushup, NULL },
## Download
- * [push-5.3.c](push-5.3.c) (2K) (20090124)
+ * [push-5.6.c](push-5.6.c) (1K) (20090709)
+ * [push-5.3.c](push-5.3.c) (1K) (20090124)