diff options
author | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
commit | c70505d7c7b7b48600f273357694b56ccf5d2a15 (patch) | |
tree | 21c27ac6ffced8d6d904e35bdb39baa5d685d829 /dwl-patches/patches/simpleborders | |
download | dotfiles-master.tar.gz dotfiles-master.tar.bz2 dotfiles-master.zip |
Diffstat (limited to 'dwl-patches/patches/simpleborders')
-rw-r--r-- | dwl-patches/patches/simpleborders/README.md | 13 | ||||
-rw-r--r-- | dwl-patches/patches/simpleborders/simpleborders-v0.6.patch | 73 | ||||
-rw-r--r-- | dwl-patches/patches/simpleborders/simpleborders-v0.7.patch | 73 |
3 files changed, 159 insertions, 0 deletions
diff --git a/dwl-patches/patches/simpleborders/README.md b/dwl-patches/patches/simpleborders/README.md new file mode 100644 index 0000000..29dcf5e --- /dev/null +++ b/dwl-patches/patches/simpleborders/README.md @@ -0,0 +1,13 @@ +### Description + +Like smartborders. Don't put borders when there is only one window on the screen. + +The patch for tag v0.7 below appears to apply cleanly to the current HEAD of +upstream/main as at 2024-10-11. + +### Download +- [git branch](https://codeberg.org/bencc/dwl/src/branch/simpleborders) +- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders-v0.7.patch) +- [v0.6](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/simpleborders/simpleborders-v0.6.patch) +### Authors +- [Ben Collerson](https://codeberg.org/bencc) diff --git a/dwl-patches/patches/simpleborders/simpleborders-v0.6.patch b/dwl-patches/patches/simpleborders/simpleborders-v0.6.patch new file mode 100644 index 0000000..a4797bb --- /dev/null +++ b/dwl-patches/patches/simpleborders/simpleborders-v0.6.patch @@ -0,0 +1,73 @@ +From 681e520deaeee460647de36f5312af3cb0c31f4a Mon Sep 17 00:00:00 2001 +From: Ben Collerson <benc@benc.cc> +Date: Sat, 30 Dec 2023 13:39:31 +1000 +Subject: [PATCH] simpleborders + +--- + dwl.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/dwl.c b/dwl.c +index 4d19357..900e651 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -245,6 +245,7 @@ static void cleanupmon(struct wl_listener *listener, void *data); + static void closemon(Monitor *m); + static void commitlayersurfacenotify(struct wl_listener *listener, void *data); + static void commitnotify(struct wl_listener *listener, void *data); ++static int countclients(Monitor *m); + static void createdecoration(struct wl_listener *listener, void *data); + static void createidleinhibitor(struct wl_listener *listener, void *data); + static void createkeyboard(struct wlr_keyboard *keyboard); +@@ -286,6 +287,7 @@ static void motionabsolute(struct wl_listener *listener, void *data); + static void motionnotify(uint32_t time); + static void motionrelative(struct wl_listener *listener, void *data); + static void moveresize(const Arg *arg); ++static int needsborder(Client *c); + static void outputmgrapply(struct wl_listener *listener, void *data); + static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test); + static void outputmgrtest(struct wl_listener *listener, void *data); +@@ -739,6 +741,17 @@ commitnotify(struct wl_listener *listener, void *data) + c->resize = 0; + } + ++int ++countclients(Monitor *m) ++{ ++ unsigned int n = 0; ++ Client *c; ++ wl_list_for_each(c, &clients, link) ++ if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen) ++ n++; ++ return n; ++} ++ + void + createdecoration(struct wl_listener *listener, void *data) + { +@@ -1697,6 +1710,14 @@ moveresize(const Arg *arg) + } + } + ++int ++needsborder(Client *c) { ++ return ((countclients(c->mon) > 1 ++ && c->mon->lt[c->mon->sellt]->arrange != monocle) ++ || c->isfloating) ++ && !c->isfullscreen; ++} ++ + void + outputmgrapply(struct wl_listener *listener, void *data) + { +@@ -1930,6 +1951,7 @@ resize(Client *c, struct wlr_box geo, int interact) + struct wlr_box clip; + client_set_bounds(c, geo.width, geo.height); + c->geom = geo; ++ c->bw = needsborder(c) ? borderpx : 0; + applybounds(c, bbox); + + /* Update scene-graph, including borders */ +-- +2.43.0 + diff --git a/dwl-patches/patches/simpleborders/simpleborders-v0.7.patch b/dwl-patches/patches/simpleborders/simpleborders-v0.7.patch new file mode 100644 index 0000000..e782d84 --- /dev/null +++ b/dwl-patches/patches/simpleborders/simpleborders-v0.7.patch @@ -0,0 +1,73 @@ +From 09759c3ef75158c366e9fc63814485fbb31a3ccf Mon Sep 17 00:00:00 2001 +From: Ben Collerson <benc@benc.cc> +Date: Sat, 30 Dec 2023 13:39:31 +1000 +Subject: [PATCH] simpleborders + +--- + dwl.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/dwl.c b/dwl.c +index a2711f67..415fe1a0 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -259,6 +259,7 @@ static void closemon(Monitor *m); + static void commitlayersurfacenotify(struct wl_listener *listener, void *data); + static void commitnotify(struct wl_listener *listener, void *data); + static void commitpopup(struct wl_listener *listener, void *data); ++static int countclients(Monitor *m); + static void createdecoration(struct wl_listener *listener, void *data); + static void createidleinhibitor(struct wl_listener *listener, void *data); + static void createkeyboard(struct wlr_keyboard *keyboard); +@@ -308,6 +309,7 @@ static void motionnotify(uint32_t time, struct wlr_input_device *device, double + double sy, double sx_unaccel, double sy_unaccel); + static void motionrelative(struct wl_listener *listener, void *data); + static void moveresize(const Arg *arg); ++static int needsborder(Client *c); + static void outputmgrapply(struct wl_listener *listener, void *data); + static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test); + static void outputmgrtest(struct wl_listener *listener, void *data); +@@ -849,6 +851,17 @@ commitpopup(struct wl_listener *listener, void *data) + wl_list_remove(&listener->link); + } + ++int ++countclients(Monitor *m) ++{ ++ unsigned int n = 0; ++ Client *c; ++ wl_list_for_each(c, &clients, link) ++ if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen) ++ n++; ++ return n; ++} ++ + void + createdecoration(struct wl_listener *listener, void *data) + { +@@ -1927,6 +1940,14 @@ moveresize(const Arg *arg) + } + } + ++int ++needsborder(Client *c) { ++ return ((countclients(c->mon) > 1 ++ && c->mon->lt[c->mon->sellt]->arrange != monocle) ++ || c->isfloating) ++ && !c->isfullscreen; ++} ++ + void + outputmgrapply(struct wl_listener *listener, void *data) + { +@@ -2190,6 +2211,7 @@ resize(Client *c, struct wlr_box geo, int interact) + + client_set_bounds(c, geo.width, geo.height); + c->geom = geo; ++ c->bw = needsborder(c) ? borderpx : 0; + applybounds(c, bbox); + + /* Update scene-graph, including borders */ +-- +2.45.2 + |