summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorChris Sobczak <chris@sobczak.family>2026-07-04 00:02:29 -0700
committerChris Sobczak <chris@sobczak.family>2026-07-04 00:02:29 -0700
commitd1f970867ff4a82c61dbdb7172566208fc820847 (patch)
tree1315a6521821b32dff0be7692c5880aa0a0c3bf6 /patches
parent1358cad2e511260a865fc0393d9db77b01f3d873 (diff)
parent48ee6efb978975a62f2b3c2ab8d144cfafd25417 (diff)
Merge branch 'alwayscenter' into csobczak-alwayscentercsobczak-alwayscenter
Apply always center patch
Diffstat (limited to 'patches')
-rw-r--r--patches/alwayscenter/README.md9
-rw-r--r--patches/alwayscenter/alwayscenter.patch25
2 files changed, 34 insertions, 0 deletions
diff --git a/patches/alwayscenter/README.md b/patches/alwayscenter/README.md
new file mode 100644
index 0000000..fae39be
--- /dev/null
+++ b/patches/alwayscenter/README.md
@@ -0,0 +1,9 @@
+### Description
+Automatically center floating windows.
+
+### Download
+- [git branch](https://codeberg.org/guidocella/dwl/src/branch/alwayscenter)
+- [2026-01-15](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/alwayscenter/alwayscenter.patch)
+
+### Authors
+- [Guido Cella](https://codeberg.org/guidocella)
diff --git a/patches/alwayscenter/alwayscenter.patch b/patches/alwayscenter/alwayscenter.patch
new file mode 100644
index 0000000..962745d
--- /dev/null
+++ b/patches/alwayscenter/alwayscenter.patch
@@ -0,0 +1,25 @@
+From 48110f0443c8e1ddcd56b6fed5da46535024919c Mon Sep 17 00:00:00 2001
+From: Guido Cella <guido@guidocella.xyz>
+Date: Tue, 13 Jan 2026 21:17:22 +0100
+Subject: [PATCH] center floating windows
+
+---
+ dwl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/dwl.c b/dwl.c
+index 44f3ad9..72714f8 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -2414,6 +2414,8 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
+ /* Make sure window actually overlaps with the monitor */
+ resize(c, c->geom, 0);
+ c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
++ c->prev.x = (m->w.width - c->prev.width) / 2 + m->m.x;
++ c->prev.y = (m->w.height - c->prev.height) / 2 + m->m.y;
+ setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+ setfloating(c, c->isfloating);
+ }
+--
+2.52.0
+