improved tile() for the RESIZEHINTS == True case, now more space is consumed by the clients (esp. if those clients use increment handling heavily) 3f3086f8
Anselm R. Garbe · 2007-09-27 20:08 1 file(s) · +6 −5
dwm.c +6 −5
1569 1569
void
1570 1570
tile(void) {
1571 1571
	unsigned int i, n, nx, ny, nw, nh, mw, th;
1572 -
	Client *c;
1572 +
	Client *c, *mc;
1573 1573
1574 1574
	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
1575 1575
		n++;
1582 1582
1583 1583
	nx = wax;
1584 1584
	ny = way;
1585 -
	for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next), i++) {
1585 +
	nw = 0; /* gcc stupidity requires this */
1586 +
	for(i = 0, c = mc = nexttiled(clients); c; c = nexttiled(c->next), i++) {
1586 1587
		c->ismax = False;
1587 1588
		if(i == 0) { /* master */
1588 1589
			nw = mw - 2 * c->border;
1591 1592
		else {  /* tile window */
1592 1593
			if(i == 1) {
1593 1594
				ny = way;
1594 -
				nx += mw;
1595 +
				nx += mc->w + 2 * mc->border;
1596 +
				nw = waw - nx - 2 * c->border;
1595 1597
			}
1596 -
			nw = waw - mw - 2 * c->border;
1597 1598
			if(i + 1 == n) /* remainder */
1598 1599
				nh = (way + wah) - ny - 2 * c->border;
1599 1600
			else
1601 1602
		}
1602 1603
		resize(c, nx, ny, nw, nh, RESIZEHINTS);
1603 1604
		if(n > 1 && th != wah)
1604 -
			ny += nh + 2 * c->border;
1605 +
			ny = c->y + c->h + 2 * c->border;
1605 1606
	}
1606 1607
}
1607 1608