summaryrefslogtreecommitdiff
path: root/patches/dwl-alwayscenter.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/dwl-alwayscenter.diff')
-rw-r--r--patches/dwl-alwayscenter.diff23
1 files changed, 23 insertions, 0 deletions
diff --git a/patches/dwl-alwayscenter.diff b/patches/dwl-alwayscenter.diff
new file mode 100644
index 0000000..24e52ba
--- /dev/null
+++ b/patches/dwl-alwayscenter.diff
@@ -0,0 +1,23 @@
+From 9173fdaf0d1eb853ff194ea11767ac15a0d13560 Mon Sep 17 00:00:00 2001
+From: Guido Cella <guido@guidocella.xyz>
+Date: Sat, 17 Apr 2021 08:59:55 +0200
+Subject: [PATCH] Center floating windows
+
+Credits to Benjamin Chausse for fixing this with multiple monitors.
+---
+ dwl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/dwl.c b/dwl.c
+index 22287fb3..80c16459 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -467,6 +467,8 @@ applyrules(Client *c)
+ mon = m;
+ }
+ }
++ 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;
+ wlr_scene_node_reparent(c->scene, layers[c->isfloating ? LyrFloat : LyrTile]);
+ setmon(c, mon, newtags);
+ }