From ba005d4de9ca4eb105b5da0241c9829e3a8339ec Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Wed, 3 May 2023 09:28:43 +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 4118fd8..b0cfb50 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->node, layers[c->isfloating ? LyrFloat : LyrTile]); setmon(c, mon, newtags); }