small change to achieve Jukka's last proposal 346bdea9
arg@mmvi · 2006-09-22 13:53 2 file(s) · +34 −14
dwm.h +2 −1
77 77
	char name[256];
78 78
	int proto;
79 79
	int x, y, w, h;
80 +
	int rx, ry, rw, rh; /* revert geometry */
80 81
	int tx, ty, tw, th; /* title window geometry */
81 82
	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
82 83
	int grav;
83 84
	long flags; 
84 85
	unsigned int border, weight;
85 -
	Bool isfloat;
86 +
	Bool isfloat, ismax;
86 87
	Bool *tags;
87 88
	Client *next;
88 89
	Client *prev;
view.c +32 −13
18 18
	return min;
19 19
}
20 20
21 +
static Client *
22 +
nexttiled(Client *c) {
23 +
	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
24 +
	return c;
25 +
}
26 +
21 27
static void
22 28
reorder() {
23 29
	Client *c, *newclients, *tail;
36 42
	clients = newclients;
37 43
}
38 44
39 -
static Client *
40 -
nexttiled(Client *c) {
41 -
	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
42 -
	return c;
45 +
static void
46 +
togglemax(Client *c)
47 +
{
48 +
	if((c->ismax = !c->ismax)) {
49 +
		c->rx = c->x; c->x = sx;
50 +
		c->ry = c->y; c->y = bh;
51 +
		c->rw = c->w; c->w = sw;
52 +
		c->rh = c->h; c->h = sh;
53 +
	}
54 +
	else {
55 +
		c->x = c->rx;
56 +
		c->y = c->ry;
57 +
		c->w = c->w;
58 +
		c->h = c->h;
59 +
	}
60 +
	resize(c, True, TopLeft);
61 +
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
43 62
}
44 63
45 64
/* extern */
82 101
83 102
	w = sw - mw;
84 103
	for(n = 0, c = clients; c; c = c->next)
85 -
		if(isvisible(c) && !c->isfloat)
86 -
			n++;
104 +
		if(isvisible(c)) {
105 +
			if(c->isfloat) {
106 +
				if(c->ismax)
107 +
					togglemax(c);
108 +
			}
109 +
			else
110 +
				n++;
111 +
		}
87 112
88 113
	if(n > 1)
89 114
		h = (sh - bh) / (n - 1);
269 294
270 295
void
271 296
zoom(Arg *arg) {
272 -
	int tmp;
273 297
	unsigned int n;
274 298
	Client *c;
275 299
	XEvent ev;
278 302
		return;
279 303
280 304
	if(sel->isfloat || (arrange == dofloat)) {
281 -
		sel->x = sx;
282 -
		sel->y = bh;
283 -
		sel->w = sw;
284 -
		sel->h = sh - bh;
285 -
		resize(sel, True, TopLeft);
286 -
		while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
305 +
		togglemax(sel);
287 306
		return;
288 307
	}
289 308