about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--event.c59
1 files changed, 16 insertions, 43 deletions
diff --git a/event.c b/event.c
index df0a5ef..fe25dee 100644
--- a/event.c
+++ b/event.c
@@ -21,23 +21,6 @@ KEYS
 #define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
 
 static void
-synconfig(Client *c, int x, int y, int w, int h, unsigned int border) {
-	XEvent synev;
-
-	synev.type = ConfigureNotify;
-	synev.xconfigure.display = dpy;
-	synev.xconfigure.event = c->win;
-	synev.xconfigure.window = c->win;
-	synev.xconfigure.x = x;
-	synev.xconfigure.y = y;
-	synev.xconfigure.width = w;
-	synev.xconfigure.height = h;
-	synev.xconfigure.border_width = border;
-	synev.xconfigure.above = None;
-	XSendEvent(dpy, c->win, True, NoEventMask, &synev);
-}
-
-static void
 movemouse(Client *c) {
 	int x1, y1, ocx, ocy, di;
 	unsigned int dui;
@@ -52,14 +35,8 @@ movemouse(Client *c) {
 	c->ismax = False;
 	XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
 	for(;;) {
-		XMaskEvent(dpy, MOUSEMASK | ExposureMask | StructureNotifyMask, &ev);
+		XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
 		switch (ev.type) {
-		default:
-			break;
-		case ConfigureRequest:
-			synconfig(c, c->x, c->y, c->w, c->h, ev.xconfigure.border_width);
-			XSync(dpy, False);
-			break;
 		case Expose:
 			handler[Expose](&ev);
 			break;
@@ -72,11 +49,6 @@ movemouse(Client *c) {
 		case ButtonRelease:
 			XUngrabPointer(dpy, CurrentTime);
 			return;
-		case DestroyNotify:
-		case UnmapNotify:
-			XUngrabPointer(dpy, CurrentTime);
-			handler[ev.type](&ev);
-			return;
 		}
 	}
 }
@@ -96,14 +68,8 @@ resizemouse(Client *c) {
 	c->ismax = False;
 	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
 	for(;;) {
-		XMaskEvent(dpy, MOUSEMASK | ExposureMask | StructureNotifyMask, &ev);
+		XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
 		switch(ev.type) {
-		default:
-			break;
-		case ConfigureRequest:
-			synconfig(c, c->x, c->y, c->w, c->h, ev.xconfigure.border_width);
-			XSync(dpy, False);
-			break;
 		case Expose:
 			handler[Expose](&ev);
 			break;
@@ -124,11 +90,6 @@ resizemouse(Client *c) {
 		case ButtonRelease:
 			XUngrabPointer(dpy, CurrentTime);
 			return;
-		case DestroyNotify:
-		case UnmapNotify:
-			XUngrabPointer(dpy, CurrentTime);
-			handler[ev.type](&ev);
-			return;
 		}
 	}
 }
@@ -187,6 +148,7 @@ configurerequest(XEvent *e) {
 	unsigned long newmask;
 	Client *c;
 	XConfigureRequestEvent *ev = &e->xconfigurerequest;
+	XEvent synev;
 	XWindowChanges wc;
 
 	if((c = getclient(ev->window))) {
@@ -210,8 +172,19 @@ configurerequest(XEvent *e) {
 		newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
 		if(newmask)
 			XConfigureWindow(dpy, c->win, newmask, &wc);
-		else
-			synconfig(c, c->x, c->y, c->w, c->h, c->border);
+		else {
+			synev.type = ConfigureNotify;
+			synev.xconfigure.display = dpy;
+			synev.xconfigure.event = c->win;
+			synev.xconfigure.window = c->win;
+			synev.xconfigure.x = c->x;
+			synev.xconfigure.y = c->y;
+			synev.xconfigure.width = c->w;
+			synev.xconfigure.height = c->h;
+			synev.xconfigure.border_width = c->border;
+			synev.xconfigure.above = None;
+			XSendEvent(dpy, c->win, True, NoEventMask, &synev);
+		}
 		XSync(dpy, False);
 		if(c->isfloat)
 			resize(c, False, TopLeft);
/pre>
f07bb12f ^

34a60763 ^
f07bb12f ^



34a60763 ^





f07bb12f ^









34a60763 ^
f07bb12f ^

34a60763 ^
f07bb12f ^

f07bb12f ^

34a60763 ^

f07bb12f ^












1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110