diff --git a/Makefile b/Makefile index d5745f6..9d0a4b0 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS) all: dwl dwl: dwl.o util.o $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@ -dwl.o: dwl.c push.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h wlr-output-power-management-unstable-v1-protocol.h +dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h wlr-output-power-management-unstable-v1-protocol.h util.o: util.c util.h # wayland-scanner is a tool which generates C headers and rigging for Wayland diff --git a/dwl.c b/dwl.c index 6c64e07..0e8942a 100644 --- a/dwl.c +++ b/dwl.c @@ -441,9 +441,7 @@ static Atom netatom[NetLast]; #endif /* configuration, allows nested code to access above variables */ -#include "push.h" #include "config.h" -#include "push.c" /* attempt to encapsulate suck into one file */ #include "client.h" diff --git a/patches/push.patch b/patches/push.patch deleted file mode 100644 index 13e2ae0..0000000 --- a/patches/push.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 0259e9a8ab52d720901bcd9fbafe7fe067b10435 Mon Sep 17 00:00:00 2001 -From: "Devin J. Pohly" -Date: Thu, 4 Mar 2021 00:45:50 -0600 -Subject: [PATCH 1/2] port dwm "push" patch to dwl - ---- - Makefile | 2 +- - dwl.c | 2 ++ - push.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 66 insertions(+), 1 deletion(-) - create mode 100644 push.c - -diff --git a/Makefile b/Makefile -index ccca0794..078ced57 100644 ---- a/Makefile -+++ b/Makefile -@@ -16,7 +16,7 @@ LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS) - all: dwl - dwl: dwl.o util.o - $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@ --dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h -+dwl.o: dwl.c push.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h - util.o: util.c util.h - - # wayland-scanner is a tool which generates C headers and rigging for Wayland -diff --git a/dwl.c b/dwl.c -index 2a8162c1..49b87c15 100644 ---- a/dwl.c -+++ b/dwl.c -@@ -370,7 +370,9 @@ static Atom netatom[NetLast]; - #endif - - /* configuration, allows nested code to access above variables */ -+#include "push.h" - #include "config.h" -+#include "push.c" - - /* attempt to encapsulate suck into one file */ - #include "client.h" -diff --git a/push.c b/push.c -new file mode 100644 -index 00000000..26ed462f ---- /dev/null -+++ b/push.c -@@ -0,0 +1,63 @@ -+static Client * -+nexttiled(Client *sel) { -+ Client *c; -+ wl_list_for_each(c, &sel->link, link) { -+ if (&c->link == &clients) -+ break; /* don't wrap */ -+ if (!c->isfloating && VISIBLEON(c, selmon)) -+ return c; -+ } -+ return NULL; -+} -+ -+static Client * -+prevtiled(Client *sel) { -+ Client *c; -+ wl_list_for_each_reverse(c, &sel->link, link) { -+ if (&c->link == &clients) -+ break; /* don't wrap */ -+ if (!c->isfloating && VISIBLEON(c, selmon)) -+ return c; -+ } -+ return NULL; -+} -+ -+static void -+pushup(const Arg *arg) { -+ Client *sel = selclient(); -+ Client *c; -+ -+ if(!sel || sel->isfloating) -+ return; -+ if((c = prevtiled(sel))) { -+ /* attach before c */ -+ wl_list_remove(&sel->link); -+ wl_list_insert(c->link.prev, &sel->link); -+ } else { -+ /* move to the end */ -+ wl_list_remove(&sel->link); -+ wl_list_insert(clients.prev, &sel->link); -+ } -+ focusclient(sel, 1); -+ arrange(selmon); -+} -+ -+static void -+pushdown(const Arg *arg) { -+ Client *sel = selclient(); -+ Client *c; -+ -+ if(!sel || sel->isfloating) -+ return; -+ if((c = nexttiled(sel))) { -+ /* attach after c */ -+ wl_list_remove(&sel->link); -+ wl_list_insert(&c->link, &sel->link); -+ } else { -+ /* move to the front */ -+ wl_list_remove(&sel->link); -+ wl_list_insert(&clients, &sel->link); -+ } -+ focusclient(sel, 1); -+ arrange(selmon); -+} - -From a4e4fd3d25d6a7e59039e38c5486e5c62adb0e2a Mon Sep 17 00:00:00 2001 -From: "Devin J. Pohly" -Date: Thu, 4 Mar 2021 13:52:58 -0600 -Subject: [PATCH 2/2] add missing header - ---- - push.h | 4 ++++ - 1 file changed, 4 insertions(+) - create mode 100644 push.h - -diff --git a/push.h b/push.h -new file mode 100644 -index 00000000..59c0f80e ---- /dev/null -+++ b/push.h -@@ -0,0 +1,4 @@ -+static Client *nexttiled(Client *sel); -+static Client *prevtiled(Client *sel); -+static void pushdown(const Arg *arg); -+static void pushup(const Arg *arg); diff --git a/push.c b/push.c deleted file mode 100644 index 323c317..0000000 --- a/push.c +++ /dev/null @@ -1,63 +0,0 @@ -static Client * -nexttiled(Client *sel) { - Client *c; - wl_list_for_each(c, &sel->link, link) { - if (&c->link == &clients) - break; /* don't wrap */ - if (!c->isfloating && VISIBLEON(c, selmon)) - return c; - } - return NULL; -} - -static Client * -prevtiled(Client *sel) { - Client *c; - wl_list_for_each_reverse(c, &sel->link, link) { - if (&c->link == &clients) - break; /* don't wrap */ - if (!c->isfloating && VISIBLEON(c, selmon)) - return c; - } - return NULL; -} - -static void -pushup(const Arg *arg) { - Client *sel = focustop(selmon); - Client *c; - - if(!sel || sel->isfloating) - return; - if((c = prevtiled(sel))) { - /* attach before c */ - wl_list_remove(&sel->link); - wl_list_insert(c->link.prev, &sel->link); - } else { - /* move to the end */ - wl_list_remove(&sel->link); - wl_list_insert(clients.prev, &sel->link); - } - focusclient(sel, 1); - arrange(selmon); -} - -static void -pushdown(const Arg *arg) { - Client *sel = focustop(selmon); - Client *c; - - if(!sel || sel->isfloating) - return; - if((c = nexttiled(sel))) { - /* attach after c */ - wl_list_remove(&sel->link); - wl_list_insert(&c->link, &sel->link); - } else { - /* move to the front */ - wl_list_remove(&sel->link); - wl_list_insert(&clients, &sel->link); - } - focusclient(sel, 1); - arrange(selmon); -} diff --git a/push.h b/push.h deleted file mode 100644 index 59c0f80..0000000 --- a/push.h +++ /dev/null @@ -1,4 +0,0 @@ -static Client *nexttiled(Client *sel); -static Client *prevtiled(Client *sel); -static void pushdown(const Arg *arg); -static void pushup(const Arg *arg);