summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-09-15 00:22:24 +0200
committerbakkeby <[email protected]>2019-09-15 00:22:24 +0200
commit713c4e619749e437970dee379d65417f9a1849b3 (patch)
treeae80930ed2da7ddb8d0c94f54d8b19fa39b3cd72 /patch
parent70012dbf2cb8eddddc4ec57ecba4508a9d9664a5 (diff)
downloaddwm-flexipatch-713c4e619749e437970dee379d65417f9a1849b3.tar.gz
dwm-flexipatch-713c4e619749e437970dee379d65417f9a1849b3.zip
Adding push no master variant patch
Diffstat (limited to 'patch')
-rw-r--r--patch/include.c4
-rw-r--r--patch/include.h4
-rw-r--r--patch/push.c4
-rw-r--r--patch/push_no_master.c43
-rw-r--r--patch/push_no_master.h3
5 files changed, 54 insertions, 4 deletions
diff --git a/patch/include.c b/patch/include.c
index 8a76a60..86de400 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -40,7 +40,9 @@
#include "pertag.c"
#endif
-#if PUSH_PATCH
+#if PUSH_NO_MASTER_PATCH
+#include "push_no_master.c"
+#elif PUSH_PATCH
#include "push.c"
#endif
diff --git a/patch/include.h b/patch/include.h
index 924ffff..e2d73df 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -36,7 +36,9 @@
#include "ewmhtags.h"
#endif
-#if PUSH_PATCH
+#if PUSH_NO_MASTER_PATCH
+#include "push_no_master.h"
+#elif PUSH_PATCH
#include "push.h"
#endif
diff --git a/patch/push.c b/patch/push.c
index 6ac156f..beeea91 100644
--- a/patch/push.c
+++ b/patch/push.c
@@ -1,4 +1,4 @@
-Client *
+static Client *
nextc(Client *c, float f)
{
if (!f)
@@ -34,7 +34,7 @@ pushup(const Arg *arg)
if (selmon->clients == c)
selmon->clients = sel;
else {
- for (c = selmon->clients; c->next != sel->next; c = c->next);
+ for (c f selmon->clients; c->next != sel->next; c = c->next);
c->next = sel;
}
} else {
diff --git a/patch/push_no_master.c b/patch/push_no_master.c
new file mode 100644
index 0000000..5ff9326
--- /dev/null
+++ b/patch/push_no_master.c
@@ -0,0 +1,43 @@
+Client *
+prevt(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
+pushup(const Arg *arg)
+{
+ Client *sel = selmon->sel, *c;
+
+ if (!sel || sel->isfloating)
+ return;
+ if ((c = prevt(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
+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);
+} \ No newline at end of file
diff --git a/patch/push_no_master.h b/patch/push_no_master.h
new file mode 100644
index 0000000..7ea061d
--- /dev/null
+++ b/patch/push_no_master.h
@@ -0,0 +1,3 @@
+Client * prevt(Client *c);
+static void pushup(const Arg *arg);
+static void pushdown(const Arg *arg); \ No newline at end of file