changed ban/unban implementation to not move the windows anymore, but map/unmap them instead - PLEASE TEST THIS a54cf2ec
Anselm R. Garbe · 2007-07-28 17:18 4 file(s) · +15 −11
client.c +9 −8
98 98
99 99
void
100 100
ban(Client *c) {
101 -
	if (c->isbanned)
101 +
	if(c->isbanned)
102 102
		return;
103 -
	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
103 +
	XUnmapWindow(dpy, c->win);
104 +
	setclientstate(c, IconicState);
104 105
	c->isbanned = True;
106 +
	c->unmapped++;
105 107
}
106 108
107 109
void
135 137
136 138
void
137 139
focus(Client *c) {
138 -
	if((!c && selscreen)|| (c && !isvisible(c)))
140 +
	if((!c && selscreen) || (c && !isvisible(c)))
139 141
		for(c = stack; c && !isvisible(c); c = c->snext);
140 142
	if(sel && sel != c) {
141 143
		grabbuttons(sel, False);
224 226
		c->isfloating = (rettrans == Success) || c->isfixed;
225 227
	attach(c);
226 228
	attachstack(c);
227 -
	ban(c);
228 -
	XMapWindow(dpy, w);
229 -
	setclientstate(c, NormalState);
229 +
	c->isbanned = True;
230 230
	focus(c);
231 231
	lt->arrange();
232 232
}
308 308
309 309
void
310 310
unban(Client *c) {
311 -
	if (!c->isbanned)
311 +
	if(!c->isbanned)
312 312
		return;
313 -
	XMoveWindow(dpy, c->win, c->x, c->y);
313 +
	XMapWindow(dpy, c->win);
314 +
	setclientstate(c, NormalState);
314 315
	c->isbanned = False;
315 316
}
316 317
config.mk +1 −1
1 1
# dwm version
2 -
VERSION = 4.3
2 +
VERSION = 4.4
3 3
4 4
# Customize below to fit your system
5 5
dwm.h +1 −0
48 48
	int rx, ry, rw, rh; /* revert geometry */
49 49
	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
50 50
	int minax, maxax, minay, maxay;
51 +
	int unmapped;
51 52
	long flags; 
52 53
	unsigned int border, oldborder;
53 54
	Bool isbanned, isfixed, ismax, isfloating;
event.c +4 −2
336 336
	Client *c;
337 337
	XUnmapEvent *ev = &e->xunmap;
338 338
339 -
	if((c = getclient(ev->window)))
340 -
		unmanage(c);
339 +
	if((c = getclient(ev->window)) && (ev->event == root)) {
340 +
		if(ev->send_event || c->unmapped-- == 0)
341 +
			unmanage(c);
342 +
	}
341 343
}
342 344
343 345
/* extern */