From fd26269b04698a9b98cf98f5e11fdb5424a0d7c6 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Fri, 10 May 2024 17:44:28 +0200 Subject: [PATCH] update alwayscenter Fixes https://codeberg.org/dwl/dwl-patches/issues/58. --- patches/alwayscenter/README.md | 2 +- patches/alwayscenter/alwayscenter.patch | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/patches/alwayscenter/README.md b/patches/alwayscenter/README.md index f85592c..d98ff67 100644 --- a/patches/alwayscenter/README.md +++ b/patches/alwayscenter/README.md @@ -3,7 +3,7 @@ Automatically center floating windows. ### Download - [git branch](https://codeberg.org/guidocella/dwl/src/branch/alwayscenter) -- [2024-02-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/alwayscenter/alwayscenter.patch) +- [2024-05-10](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 index 3664763..f9d662a 100644 --- a/patches/alwayscenter/alwayscenter.patch +++ b/patches/alwayscenter/alwayscenter.patch @@ -1,25 +1,27 @@ -From 95ac2fd73af8cee3ce3e556c254e60a2ca985515 Mon Sep 17 00:00:00 2001 +From 54b6c4591aeae583ea87fabde0d16b81f420288d Mon Sep 17 00:00:00 2001 From: Guido Cella -Date: Tue, 16 Jan 2024 18:14:50 +0100 +Date: Fri, 10 May 2024 17:43:33 +0200 Subject: [PATCH] center floating windows --- - dwl.c | 2 ++ - 1 file changed, 2 insertions(+) + dwl.c | 4 ++++ + 1 file changed, 4 insertions(+) diff --git a/dwl.c b/dwl.c -index 95ebee8..ac077e3 100644 +index d508d79..1c3c227 100644 --- a/dwl.c +++ b/dwl.c -@@ -453,6 +453,8 @@ applyrules(Client *c) +@@ -470,6 +470,10 @@ applyrules(Client *c) } } } -+ c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x; -+ c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y; ++ if (mon) { ++ c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x; ++ c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y; ++ } setmon(c, mon, newtags); } -- -2.43.0 +2.45.0