From 96c1d909b6b50cc842076769e444a467eab9b0ee Mon Sep 17 00:00:00 2001 From: "P.P.A" Date: Sat, 8 Jul 2023 09:27:09 +0200 Subject: push --- dwm-push_no_master-6.4.diff | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 dwm-push_no_master-6.4.diff (limited to 'dwm-push_no_master-6.4.diff') diff --git a/dwm-push_no_master-6.4.diff b/dwm-push_no_master-6.4.diff new file mode 100644 index 0000000..11f76a2 --- /dev/null +++ b/dwm-push_no_master-6.4.diff @@ -0,0 +1,70 @@ +diff --git a/dwm.c b/dwm.c +index e5efb6a..660a8ac 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -186,7 +186,10 @@ static void motionnotify(XEvent *e); + static void movemouse(const Arg *arg); + static Client *nexttiled(Client *c); + static void pop(Client *c); ++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); +@@ -1209,6 +1212,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) + { +@@ -1246,6 +1259,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) + { -- cgit v1.2.3