dwm.c
changeset 1016 3027df4b2c0d
parent 1014 35461e0a4894
child 1017 585e3422edc8
equal deleted inserted replaced
1015:f052223df8d5 1016:3027df4b2c0d
  1567 }
  1567 }
  1568 
  1568 
  1569 void
  1569 void
  1570 tile(void) {
  1570 tile(void) {
  1571 	unsigned int i, n, nx, ny, nw, nh, mw, th;
  1571 	unsigned int i, n, nx, ny, nw, nh, mw, th;
  1572 	Client *c;
  1572 	Client *c, *mc;
  1573 
  1573 
  1574 	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
  1574 	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
  1575 		n++;
  1575 		n++;
  1576 
  1576 
  1577 	/* window geoms */
  1577 	/* window geoms */
  1580 	if(n > 1 && th < bh)
  1580 	if(n > 1 && th < bh)
  1581 		th = wah;
  1581 		th = wah;
  1582 
  1582 
  1583 	nx = wax;
  1583 	nx = wax;
  1584 	ny = way;
  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 		c->ismax = False;
  1587 		c->ismax = False;
  1587 		if(i == 0) { /* master */
  1588 		if(i == 0) { /* master */
  1588 			nw = mw - 2 * c->border;
  1589 			nw = mw - 2 * c->border;
  1589 			nh = wah - 2 * c->border;
  1590 			nh = wah - 2 * c->border;
  1590 		}
  1591 		}
  1591 		else {  /* tile window */
  1592 		else {  /* tile window */
  1592 			if(i == 1) {
  1593 			if(i == 1) {
  1593 				ny = way;
  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 			if(i + 1 == n) /* remainder */
  1598 			if(i + 1 == n) /* remainder */
  1598 				nh = (way + wah) - ny - 2 * c->border;
  1599 				nh = (way + wah) - ny - 2 * c->border;
  1599 			else
  1600 			else
  1600 				nh = th - 2 * c->border;
  1601 				nh = th - 2 * c->border;
  1601 		}
  1602 		}
  1602 		resize(c, nx, ny, nw, nh, RESIZEHINTS);
  1603 		resize(c, nx, ny, nw, nh, RESIZEHINTS);
  1603 		if(n > 1 && th != wah)
  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 
  1608 void
  1609 void
  1609 togglebar(const char *arg) {
  1610 togglebar(const char *arg) {