Configure geometry before applying rules cd2d7549
Configuring geometry before applying rules makes it possible to have
more complex constraints in applyrules that depend on the initial window
dimensions and location.
Eric Pruitt · 2016-05-25 16:33 1 file(s) · +7 −6
dwm.c +7 −6
1043 1043
1044 1044
	c = ecalloc(1, sizeof(Client));
1045 1045
	c->win = w;
1046 +
	/* geometry */
1047 +
	c->x = c->oldx = wa->x;
1048 +
	c->y = c->oldy = wa->y;
1049 +
	c->w = c->oldw = wa->width;
1050 +
	c->h = c->oldh = wa->height;
1051 +
	c->oldbw = wa->border_width;
1052 +
1046 1053
	updatetitle(c);
1047 1054
	if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
1048 1055
		c->mon = t->mon;
1051 1058
		c->mon = selmon;
1052 1059
		applyrules(c);
1053 1060
	}
1054 -
	/* geometry */
1055 -
	c->x = c->oldx = wa->x;
1056 -
	c->y = c->oldy = wa->y;
1057 -
	c->w = c->oldw = wa->width;
1058 -
	c->h = c->oldh = wa->height;
1059 -
	c->oldbw = wa->border_width;
1060 1061
1061 1062
	if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw)
1062 1063
		c->x = c->mon->mx + c->mon->mw - WIDTH(c);