[dev] centering floating windows

From: S. R. Gal <Swiatoslaw.Gal_AT_math.uni.wroc.pl>
Date: Wed, 12 May 2021 15:07:31 +0200

Dear All,

applying the following patch:

diff --git a/dwm.c b/dwm.c
index b0b3466..c6d5de8 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -1057,6 +1057,8 @@ manage(Window w, XWindowAttributes *wa)
        updatewindowtype(c);
        updatesizehints(c);
        updatewmhints(c);
+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
        XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
        grabbuttons(c, 0);
        if (!c->isfloating)

I get floating widdows centered. Although if I want to specify geometry manually
(eg. st -g) it does not work (the window gets centered anyway). Any idea how
to fix that?

Sincerely,
s.
Received on Wed May 12 2021 - 15:07:31 CEST

This archive was generated by hypermail 2.3.0 : Wed May 12 2021 - 15:12:09 CEST