added ban() which takes care than a banned window is not banned again... (this reduces the overall ConfigureNotify's to clients) 3ce8c9f3
Anselm R. Garbe · 2007-02-14 14:01 5 file(s) · +19 −7
client.c +9 −1
68 68
/* extern */
69 69
70 70
void
71 +
ban(Client *c) {
72 +
	if(!c || c->isbanned)
73 +
		return;
74 +
	c->isbanned = True;
75 +
	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
76 +
}
77 +
78 +
void
71 79
configure(Client *c) {
72 80
	XConfigureEvent ce;
73 81
190 198
	c->next = clients;
191 199
	c->snext = stack;
192 200
	stack = clients = c;
193 -
	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
201 +
	ban(c);
194 202
	XMapWindow(dpy, c->win);
195 203
	setclientstate(c, NormalState);
196 204
	if(isvisible(c))
config.mk +1 −1
1 1
# dwm version
2 -
VERSION = 3.5
2 +
VERSION = 3.6
3 3
4 4
# Customize below to fit your system
5 5
dwm.h +2 −1
73 73
	int minax, minay, maxax, maxay;
74 74
	long flags; 
75 75
	unsigned int border;
76 -
	Bool isfixed, isfloat, ismax;
76 +
	Bool isbanned, isfixed, isfloat, ismax;
77 77
	Bool *tags;
78 78
	Client *next;
79 79
	Client *prev;
99 99
extern Window root, barwin;
100 100
101 101
/* client.c */
102 +
extern void ban(Client *c);			/* ban c */
102 103
extern void configure(Client *c);		/* send synthetic configure event */
103 104
extern void focus(Client *c);			/* focus c, c may be NULL */
104 105
extern Client *getclient(Window w);		/* return client of w */
event.c +1 −1
189 189
				configure(c);
190 190
			resize(c, False);
191 191
			if(!isvisible(c))
192 -
				XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
192 +
				ban(c);
193 193
		}
194 194
		else
195 195
			configure(c);
view.c +6 −3
55 55
	Client *c;
56 56
57 57
	for(c = clients; c; c = c->next) {
58 -
		if(isvisible(c))
58 +
		if(isvisible(c)) {
59 +
			c->isbanned = False;
59 60
			resize(c, True);
61 +
		}
60 62
		else
61 -
			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
63 +
			ban(c);
62 64
	}
63 65
	if(!sel || !isvisible(sel)) {
64 66
		for(c = stack; c && !isvisible(c); c = c->snext);
82 84
83 85
	for(i = 0, c = clients; c; c = c->next)
84 86
		if(isvisible(c)) {
87 +
			c->isbanned = False;
85 88
			if(c->isfloat) {
86 89
				resize(c, True);
87 90
				continue;
108 111
			i++;
109 112
		}
110 113
		else
111 -
			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
114 +
			ban(c);
112 115
	if(!sel || !isvisible(sel)) {
113 116
		for(c = stack; c && !isvisible(c); c = c->snext);
114 117
		focus(c);