commit 49ec9ae7be6c3b73f365746bfd5c715fbfe0b922
parent 325c2b821b415bb56b61fdbab3092faf143d1819
Author: wh1tepearl <wh1tepearl@gmail.com>
Date: Sat, 24 Jan 2026 21:32:56 +0000
always center new floating windows support
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules.def.h b/modules.def.h
@@ -13,5 +13,6 @@
#define FULLSCREEN 0 //support for toggling fullscreen
#define MOVE_IN_TILED 0 //support for moving windows in tiled mode
#define EWMH_TAGS 0 //support for EWMH tags, recommended if you want to use external bars with less pain
+#define ALWAYS_CENTER_NEW_FLOATING_WINDOWS 0 //so, basically, it does what it says
#endif
diff --git a/vxwm.c b/vxwm.c
@@ -1105,6 +1105,10 @@ manage(Window w, XWindowAttributes *wa)
updatewindowtype(c);
updatesizehints(c);
updatewmhints(c);
+#if ALWAYS_CENTER_NEW_FLOATING_WINDOWS
+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
+#endif
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
grabbuttons(c, 0);
if (!c->isfloating)