dwm

dynamic window manager

git clone https://9o.is/git/dwm.git

commit 076cfe1a9914d62d3e10d276e931f1d359a4cbe2
parent 904cf2a0eb1d06a1d0f1c3774c475bec94e2f68f
Author: Eric Pruitt <eric.pruitt@gmail.com>
Date:   Wed, 25 May 2016 16:33:11 -0700

Configure geometry before applying rules

Configuring geometry before applying rules makes it possible to have
more complex constraints in applyrules that depend on the initial window
dimensions and location.

Diffstat:
Mdwm.c | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -1043,6 +1043,13 @@ manage(Window w, XWindowAttributes *wa) c = ecalloc(1, sizeof(Client)); c->win = w; + /* geometry */ + c->x = c->oldx = wa->x; + c->y = c->oldy = wa->y; + c->w = c->oldw = wa->width; + c->h = c->oldh = wa->height; + c->oldbw = wa->border_width; + updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { c->mon = t->mon; @@ -1051,12 +1058,6 @@ manage(Window w, XWindowAttributes *wa) c->mon = selmon; applyrules(c); } - /* geometry */ - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) c->x = c->mon->mx + c->mon->mw - WIDTH(c);