diff options
author | Eric Pruitt <eric.pruitt@gmail.com> | 2016-05-25 16:33:11 -0700 |
---|---|---|
committer | Anselm R Garbe <anselm@garbe.us> | 2016-06-24 05:38:58 +0200 |
commit | cd2d7549b3ae5ec234b45d85608f79f4d3aaa851 (patch) | |
tree | ad0ff250266c4fbe6f9125de922bab75ac95cdde | |
parent | 3465bed290abc62cb2e69a8096084ba6b8eb4956 (diff) | |
download | dwm-cd2d7549b3ae5ec234b45d85608f79f4d3aaa851.tar dwm-cd2d7549b3ae5ec234b45d85608f79f4d3aaa851.tar.gz dwm-cd2d7549b3ae5ec234b45d85608f79f4d3aaa851.tar.bz2 |
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.
-rw-r--r-- | dwm.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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); |