From cc4d3d2e4baa03217f08ca7453bc107a1ba791ca Mon Sep 17 00:00:00 2001 From: Chris Sobczak Date: Sat, 4 Jul 2026 00:00:35 -0700 Subject: Download patch --- patches/alwayscenter/README.md | 9 +++++++++ patches/alwayscenter/alwayscenter.patch | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 patches/alwayscenter/README.md create mode 100644 patches/alwayscenter/alwayscenter.patch 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 +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 + -- cgit v1.2.3