mirror of
https://git.suckless.org/dwm
synced 2024-12-26 10:56:31 +00:00
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.
This commit is contained in:
parent
3465bed290
commit
cd2d7549b3
1 changed files with 7 additions and 6 deletions
13
dwm.c
13
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);
|
||||
|
|
Loading…
Reference in a new issue