s/nextunfloating/nexttiled/, changed zoom() behavior f8525040
Anselm R Garbe · 2008-05-22 11:12 1 file(s) · +12 −12
dwm.c +12 −12
156 156
void mappingnotify(XEvent *e);
157 157
void maprequest(XEvent *e);
158 158
void movemouse(Client *c);
159 -
Client *nextunfloating(Client *c);
159 +
Client *nexttiled(Client *c);
160 160
void propertynotify(XEvent *e);
161 161
void quit(const void *arg);
162 162
void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
1051 1051
}
1052 1052
1053 1053
Client *
1054 -
nextunfloating(Client *c) {
1054 +
nexttiled(Client *c) {
1055 1055
	for(; c && (c->isfloating || !isvisible(c)); c = c->next);
1056 1056
	return c;
1057 1057
}
1464 1464
	uint i, n;
1465 1465
	Client *c;
1466 1466
1467 -
	for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++);
1467 +
	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++);
1468 1468
	if(n == 0)
1469 1469
		return;
1470 1470
1471 1471
	/* master */
1472 -
	c = nextunfloating(clients);
1472 +
	c = nexttiled(clients);
1473 1473
1474 1474
	if(n == 1)
1475 1475
		tileresize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw);
1487 1487
	if(h < bh)
1488 1488
		h = th;
1489 1489
1490 -
	for(i = 0, c = nextunfloating(c->next); c; c = nextunfloating(c->next), i++) {
1490 +
	for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
1491 1491
		if(i + 1 == n) /* remainder */
1492 1492
			tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw);
1493 1493
		else
1789 1789
zoom(const void *arg) {
1790 1790
	Client *c = sel;
1791 1791
1792 -
	if(c == nextunfloating(clients))
1793 -
		if(!c || !(c = nextunfloating(c->next)))
1792 +
	if(!lt->arrange || sel->isfloating)
1793 +
		return;
1794 +
	if(c == nexttiled(clients))
1795 +
		if(!c || !(c = nexttiled(c->next)))
1794 1796
			return;
1795 -
	if(lt->arrange == tile && !sel->isfloating) {
1796 -
		detach(c);
1797 -
		attach(c);
1798 -
		focus(c);
1799 -
	}
1797 +
	detach(c);
1798 +
	attach(c);
1799 +
	focus(c);
1800 1800
	arrange();
1801 1801
}
1802 1802