about summary refs log tree commit diff stats
path: root/mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'mouse.c')
-rw-r--r--mouse.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mouse.c b/mouse.c
index 577f23c..896d6b0 100644
--- a/mouse.c
+++ b/mouse.c
@@ -45,21 +45,21 @@ mresize(Client *c)
 	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
 				None, cursor[CurResize], CurrentTime) != GrabSuccess)
 		return;
-	XGrabServer(dpy);
 	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
 	for(;;) {
-		XMaskEvent(dpy, MouseMask, &ev);
+		XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
 		switch(ev.type) {
 		default: break;
+		case Expose:
+			handler[Expose](&ev);
+			break;
 		case MotionNotify:
-			XUngrabServer(dpy);
+			XFlush(dpy);
 			mmatch(c, old_cx, old_cy, ev.xmotion.x, ev.xmotion.y);
 			XResizeWindow(dpy, c->win, c->w, c->h);
-			XGrabServer(dpy);
 			break;
 		case ButtonRelease:
 			resize(c);
-			XUngrabServer(dpy);
 			XUngrabPointer(dpy, CurrentTime);
 			return;
 		}
@@ -80,21 +80,21 @@ mmove(Client *c)
 				None, cursor[CurMove], CurrentTime) != GrabSuccess)
 		return;
 	XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
-	XGrabServer(dpy);
 	for(;;) {
-		XMaskEvent(dpy, MouseMask, &ev);
+		XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
 		switch (ev.type) {
 		default: break;
+		case Expose:
+			handler[Expose](&ev);
+			break;
 		case MotionNotify:
-			XUngrabServer(dpy);
+			XFlush(dpy);
 			c->x = old_cx + (ev.xmotion.x - x1);
 			c->y = old_cy + (ev.xmotion.y - y1);
 			XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
-			XGrabServer(dpy);
 			break;
 		case ButtonRelease:
 			resize(c);
-			XUngrabServer(dpy);
 			XUngrabPointer(dpy, CurrentTime);
 			return;
 		}
5b5a77a7457b9cc05547'>^
9a524793 ^
47287fbf ^
9a524793 ^
7817fdb2 ^
9a524793 ^
















































47287fbf ^
9a524793 ^



47287fbf ^









9a524793 ^





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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126