From 108f6d35f06a2bc10dfe49cf4bba3c3e40e8f77b Mon Sep 17 00:00:00 2001 From: MayOrMayNotBeACat Date: Sun, 11 May 2025 21:43:34 -0400 Subject: [PATCH] Add attachfocused patch. This patch changes dwl to make new clients attach below the currently focused one, like you can do on hyprland. --- patches/attachfocused/README.md | 13 ++++++++++ patches/attachfocused/attachfocused.patch | 29 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 patches/attachfocused/README.md create mode 100644 patches/attachfocused/attachfocused.patch diff --git a/patches/attachfocused/README.md b/patches/attachfocused/README.md new file mode 100644 index 0000000..59184ee --- /dev/null +++ b/patches/attachfocused/README.md @@ -0,0 +1,13 @@ +### Description +Makes windows attach below the currently active window. + +### Download +- [0.7](/dwl/dwl-patches/raw/branch/main/patches/attachfocused/attachfocused.patch) + Use the ^RAW^ patch link here + ^^^ "0.7" is an example. Use the release that your patch targets + +### Authors - latest at top [Codeberg nick is mandatory; other contact methods optional] +- [YOUR_NICK](https://codeberg.org/USERNAME) + your_email@if_you_wish_to.share.it + your_irc_nick at [Libera IRC dwl channel](https://web.libera.chat/?channels=#dwl) + your_discord_handle at [dwl Discord](https://discord.gg/jJxZnrGPWN) diff --git a/patches/attachfocused/attachfocused.patch b/patches/attachfocused/attachfocused.patch new file mode 100644 index 0000000..2b8cd38 --- /dev/null +++ b/patches/attachfocused/attachfocused.patch @@ -0,0 +1,29 @@ +From d03851c14073874f5b3d19a095e184dc24d219cd Mon Sep 17 00:00:00 2001 +From: MayOrMayNotBeACat +Date: Sun, 11 May 2025 20:24:51 -0400 +Subject: [PATCH] Make new windows attach to active client + +--- + dwl.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/dwl.c b/dwl.c +index cf3ef70..1907c5f 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -1726,7 +1726,11 @@ mapnotify(struct wl_listener *listener, void *data) + c->geom.height += 2 * c->bw; + + /* Insert this client into client lists. */ +- wl_list_insert(&clients, &c->link); ++ Client* focused = focustop(selmon); ++ if (focused) ++ wl_list_insert(&focused->link, &c->link); ++ else ++ wl_list_insert(&clients, &c->link); + wl_list_insert(&fstack, &c->flink); + + /* Set initial monitor, tags, floating status, and focus: +-- +2.49.0 +