24 lines
696 B
Diff
24 lines
696 B
Diff
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);
|
|
}
|