applied Donald Chai's showhide patch in slightly modified ways c1c6fdc5
Anselm R Garbe · 2008-09-06 09:21 1 file(s) · +16 −12
dwm.c +16 −12
180 180
static void setlayout(const Arg *arg);
181 181
static void setmfact(const Arg *arg);
182 182
static void setup(void);
183 +
static void showhide(Client *c);
183 184
static void spawn(const Arg *arg);
184 185
static void tag(const Arg *arg);
185 186
static int textnw(const char *text, unsigned int len);
271 272
272 273
void
273 274
arrange(void) {
274 -
	Client *c;
275 -
276 -
	for(c = clients; c; c = c->next)
277 -
		if(ISVISIBLE(c)) {
278 -
			XMoveWindow(dpy, c->win, c->x, c->y);
279 -
			if(!lt[sellt]->arrange || c->isfloating)
280 -
				resize(c, c->x, c->y, c->w, c->h, True);
281 -
		}
282 -
		else {
283 -
			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
284 -
		}
285 -
275 +
	if(stack)
276 +
		showhide(stack);
286 277
	focus(NULL);
287 278
	if(lt[sellt]->arrange)
288 279
		lt[sellt]->arrange();
1374 1365
	XSelectInput(dpy, root, wa.event_mask);
1375 1366
1376 1367
	grabkeys();
1368 +
}
1369 +
1370 +
void
1371 +
showhide(Client *c) {
1372 +
	if(ISVISIBLE(c)) { /* show clients top down */
1373 +
		XMoveWindow(dpy, c->win, c->x, c->y);
1374 +
		if(!lt[sellt]->arrange || c->isfloating)
1375 +
			resize(c, c->x, c->y, c->w, c->h, True);
1376 +
	}
1377 +
	if(c->snext) /* hide clients bottom up */
1378 +
		showhide(c->snext);
1379 +
	if(!ISVISIBLE(c))
1380 +
		XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
1377 1381
}
1378 1382
1379 1383
void