removed Layout->updategeom, unnecessary 2d4faae5
Anselm R Garbe · 2008-05-26 09:54 2 file(s) · +16 −28
config.def.h +3 −3
27 27
Bool resizehints       = True;     /* False means respect size hints in tiled resizals */
28 28
29 29
Layout layouts[] = {
30 -
	/* symbol     arrange  geom */
31 -
	{ "[]=",      tile,    updatetilegeom }, /* first entry is default */
32 -
	{ "><>",      NULL,    NULL           }, /* no layout function means floating behavior */
30 +
	/* symbol     arrange function */
31 +
	{ "[]=",      tile }, /* first entry is default */
32 +
	{ "><>",      NULL }, /* no layout function means floating behavior */
33 33
};
34 34
35 35
/* key definitions */
dwm.c +13 −25
105 105
typedef struct {
106 106
	const char *symbol;
107 107
	void (*arrange)(void);
108 -
	void (*updategeom)(void);
109 108
} Layout;
110 109
111 110
typedef struct {
183 182
void updatebar(void);
184 183
void updategeom(void);
185 184
void updatesizehints(Client *c);
186 -
void updatetilegeom(void);
187 185
void updatetitle(Client *c);
188 186
void updatewmhints(Client *c);
189 187
void view(const void *arg);
197 195
char stext[256];
198 196
int screen, sx, sy, sw, sh;
199 197
int bx, by, bw, bh, blw, wx, wy, ww, wh;
200 -
int mx, my, mw, mh, tx, ty, tw, th;
201 198
uint seltags = 0;
202 199
int (*xerrorxlib)(Display *, XErrorEvent *);
203 200
uint numlockmask = 0;
1315 1312
	if(d < 0.1 || d > 0.9)
1316 1313
		return;
1317 1314
	mfact = d;
1318 -
	updatetilegeom();
1319 1315
	arrange();
1320 1316
}
1321 1317
1439 1435
1440 1436
void
1441 1437
tile(void) {
1442 -
	int x, y, h, w;
1438 +
	int x, y, h, w, mx, my, mw, mh, tx, ty, tw, th;
1443 1439
	uint i, n;
1444 1440
	Client *c;
1445 1441
1446 1442
	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++);
1447 1443
	if(n == 0)
1448 1444
		return;
1445 +
1446 +
	/* master area geometry */
1447 +
	mx = wx;
1448 +
	my = wy;
1449 +
	mw = mfact * ww;
1450 +
	mh = wh;
1451 +
1452 +
	/* tile area geometry */
1453 +
	tx = mx + mw;
1454 +
	ty = wy;
1455 +
	tw = ww - mw;
1456 +
	th = wh;
1449 1457
1450 1458
	/* master */
1451 1459
	c = nexttiled(clients);
1613 1621
	bx = wx;
1614 1622
	by = showbar ? (topbar ? wy - bh : wy + wh) : -bh;
1615 1623
	bw = ww;
1616 -
1617 -
	/* update layout geometries */
1618 -
	for(i = 0; i < LENGTH(layouts); i++)
1619 -
		if(layouts[i].updategeom)
1620 -
			layouts[i].updategeom();
1621 1624
}
1622 1625
1623 1626
void
1670 1673
		c->minax = c->maxax = c->minay = c->maxay = 0;
1671 1674
	c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
1672 1675
			&& c->maxw == c->minw && c->maxh == c->minh);
1673 -
}
1674 -
1675 -
void
1676 -
updatetilegeom(void) {
1677 -
	/* master area geometry */
1678 -
	mx = wx;
1679 -
	my = wy;
1680 -
	mw = mfact * ww;
1681 -
	mh = wh;
1682 -
1683 -
	/* tile area geometry */
1684 -
	tx = mx + mw;
1685 -
	ty = wy;
1686 -
	tw = ww - mw;
1687 -
	th = wh;
1688 1676
}
1689 1677
1690 1678
void