added configure(), but this doesn't really fix those frking broken SDL apps b4d53bf1
arg@mmvi · 2006-09-26 07:40 3 file(s) · +27 −13
client.c +18 −0
81 81
}
82 82
83 83
void
84 +
configure(Client *c) {
85 +
	XEvent synev;
86 +
87 +
	synev.type = ConfigureNotify;
88 +
	synev.xconfigure.display = dpy;
89 +
	synev.xconfigure.event = c->win;
90 +
	synev.xconfigure.window = c->win;
91 +
	synev.xconfigure.x = c->x;
92 +
	synev.xconfigure.y = c->y;
93 +
	synev.xconfigure.width = c->w;
94 +
	synev.xconfigure.height = c->h;
95 +
	synev.xconfigure.border_width = c->border;
96 +
	synev.xconfigure.above = None;
97 +
	XSendEvent(dpy, c->win, True, NoEventMask, &synev);
98 +
}
99 +
100 +
void
84 101
focus(Client *c) {
85 102
	Client *old;
86 103
299 316
	else
300 317
		wc.border_width = 1;
301 318
	XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
319 +
	configure(c);
302 320
	XSync(dpy, False);
303 321
}
304 322
dwm.h +1 −0
109 109
110 110
/* client.c */
111 111
extern void ban(Client *c);			/* ban c from screen */
112 +
extern void configure(Client *c);		/* send synthetic configure event */
112 113
extern void focus(Client *c);			/* focus c, c may be NULL */
113 114
extern Client *getclient(Window w);		/* return client of w */
114 115
extern Client *getctitle(Window w);		/* return client of title window */
event.c +8 −13
1 +
#include <stdio.h>
1 2
/*
2 3
 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 4
 * See LICENSE file for license details.
38 39
		XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
39 40
		switch (ev.type) {
40 41
		case ButtonRelease:
42 +
			resize(c, True, TopLeft);
41 43
			XUngrabPointer(dpy, CurrentTime);
42 44
			return;
43 45
		case Expose:
71 73
		XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
72 74
		switch(ev.type) {
73 75
		case ButtonRelease:
76 +
			resize(c, True, TopLeft);
74 77
			XUngrabPointer(dpy, CurrentTime);
75 78
			return;
76 79
		case Expose:
151 154
	XEvent synev;
152 155
	XWindowChanges wc;
153 156
157 +
	fputs("configurerequest\n", stderr);
154 158
	if((c = getclient(ev->window))) {
155 159
		c->ismax = False;
156 160
		gravitate(c, True);
172 176
		newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
173 177
		if(newmask)
174 178
			XConfigureWindow(dpy, c->win, newmask, &wc);
175 -
		else {
176 -
			synev.type = ConfigureNotify;
177 -
			synev.xconfigure.display = dpy;
178 -
			synev.xconfigure.event = c->win;
179 -
			synev.xconfigure.window = c->win;
180 -
			synev.xconfigure.x = c->x;
181 -
			synev.xconfigure.y = c->y;
182 -
			synev.xconfigure.width = c->w;
183 -
			synev.xconfigure.height = c->h;
184 -
			synev.xconfigure.border_width = c->border;
185 -
			synev.xconfigure.above = None;
186 -
			XSendEvent(dpy, c->win, True, NoEventMask, &synev);
187 -
		}
179 +
		else
180 +
			configure(c);
188 181
		XSync(dpy, False);
189 182
		if(c->isfloat)
190 183
			resize(c, False, TopLeft);
218 211
	Client *c;
219 212
	XCrossingEvent *ev = &e->xcrossing;
220 213
214 +
	fputs("enternotify\n", stderr);
221 215
	if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
222 216
		return;
223 217
305 299
	Window trans;
306 300
	XPropertyEvent *ev = &e->xproperty;
307 301
302 +
	fputs("propertynotify\n", stderr);
308 303
	if(ev->state == PropertyDelete)
309 304
		return; /* ignore */
310 305