summaryrefslogtreecommitdiff
path: root/patches/dwm-push_no_master-6.2.diff
diff options
context:
space:
mode:
authorZachIR <zachir@protonmail.com>2020-09-13 22:37:45 -0500
committerZachIR <zachir@protonmail.com>2020-09-13 22:37:45 -0500
commitb07674dc03506126b26209689a0fff6efcdc3fcc (patch)
treec9e95fce1ce0a968b2e3c004685763e4fb8ac282 /patches/dwm-push_no_master-6.2.diff
parenta8e9513783f335b1ac7255e40a663adfffc4b475 (diff)
Update repo to 09132020
Diffstat (limited to 'patches/dwm-push_no_master-6.2.diff')
-rw-r--r--patches/dwm-push_no_master-6.2.diff70
1 files changed, 70 insertions, 0 deletions
diff --git a/patches/dwm-push_no_master-6.2.diff b/patches/dwm-push_no_master-6.2.diff
new file mode 100644
index 0000000..873e438
--- /dev/null
+++ b/patches/dwm-push_no_master-6.2.diff
@@ -0,0 +1,70 @@
+diff --git a/dwm.c b/dwm.c
+index 4465af1..49e63f0 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -185,7 +185,10 @@ static void motionnotify(XEvent *e);
+ static void movemouse(const Arg *arg);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *);
++static Client *prevtiled(Client *c);
+ static void propertynotify(XEvent *e);
++static void pushdown(const Arg *arg);
++static void pushup(const Arg *arg);
+ static void quit(const Arg *arg);
+ static Monitor *recttomon(int x, int y, int w, int h);
+ static void resize(Client *c, int x, int y, int w, int h, int interact);
+@@ -1208,6 +1211,16 @@ pop(Client *c)
+ arrange(c->mon);
+ }
+
++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;
++}
++
+ void
+ propertynotify(XEvent *e)
+ {
+@@ -1245,6 +1258,37 @@ propertynotify(XEvent *e)
+ }
+ }
+
++void
++pushdown(const Arg *arg) {
++ Client *sel = selmon->sel, *c;
++
++ if(!sel || sel->isfloating || sel == nexttiled(selmon->clients))
++ return;
++ if((c = nexttiled(sel->next))) {
++ detach(sel);
++ sel->next = c->next;
++ c->next = sel;
++ }
++ focus(sel);
++ arrange(selmon);
++}
++
++void
++pushup(const Arg *arg) {
++ Client *sel = selmon->sel, *c;
++
++ if(!sel || sel->isfloating)
++ return;
++ if((c = prevtiled(sel)) && c != nexttiled(selmon->clients)) {
++ detach(sel);
++ sel->next = c;
++ for(c = selmon->clients; c->next != sel->next; c = c->next);
++ c->next = sel;
++ }
++ focus(sel);
++ arrange(selmon);
++}
++
+ void
+ quit(const Arg *arg)
+ {