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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mouse.c b/mouse.c
index 2b5d63b..07b533c 100644
--- a/mouse.c
+++ b/mouse.c
@@ -42,7 +42,7 @@ mresize(Client *c)
 
 	old_cx = c->r[RFloat].x;
 	old_cy = c->r[RFloat].y;
-	if(XGrabPointer(dpy, c->win, False, MouseMask, GrabModeAsync, GrabModeAsync,
+	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
 				None, cursor[CurResize], CurrentTime) != GrabSuccess)
 		return;
 	XGrabServer(dpy);
@@ -55,10 +55,12 @@ mresize(Client *c)
 		case MotionNotify:
 			XUngrabServer(dpy);
 			mmatch(c, old_cx, old_cy, ev.xmotion.x, ev.xmotion.y);
-			resize(c);
+			XResizeWindow(dpy, c->win, c->r[RFloat].width, c->r[RFloat].height);
 			XGrabServer(dpy);
 			break;
 		case ButtonRelease:
+			resize(c);
+			XUngrabServer(dpy);
 			XUngrabPointer(dpy, CurrentTime);
 			return;
 		}
@@ -75,7 +77,7 @@ mmove(Client *c)
 
 	old_cx = c->r[RFloat].x;
 	old_cy = c->r[RFloat].y;
-	if(XGrabPointer(dpy, c->win, False, MouseMask, GrabModeAsync, GrabModeAsync,
+	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
 				None, cursor[CurMove], CurrentTime) != GrabSuccess)
 		return;
 	XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
@@ -88,10 +90,12 @@ mmove(Client *c)
 			XUngrabServer(dpy);
 			c->r[RFloat].x = old_cx + (ev.xmotion.x - x1);
 			c->r[RFloat].y = old_cy + (ev.xmotion.y - y1);
-			resize(c);
+			XMoveResizeWindow(dpy, c->win, c->r[RFloat].x, c->r[RFloat].y,
+					c->r[RFloat].width, c->r[RFloat].height);
 			XGrabServer(dpy);
 			break;
 		case ButtonRelease:
+			resize(c);
 			XUngrabServer(dpy);
 			XUngrabPointer(dpy, CurrentTime);
 			return;
R. Garbe <garbeam@wmii.de> 2006-07-15 17:00:56 +0200 committer Anselm R. Garbe <garbeam@wmii.de> 2006-07-15 17:00:56 +0200 proceeded with cleaning up, sorting functions, etc' href='/acidbong/suckless/dwm/commit/util.c?h=5.1&id=adaa28a6e600f636f5e86244ccef69e98419ba1a'>adaa28a ^
39677ec ^



dc5d967 ^
39677ec ^




39677ec ^
8f698bd ^

adaa28a ^
dc5d967 ^
adaa28a ^


849e631 ^
adaa28a ^


c47da14 ^
439e15d ^
9955ddc ^
dc5d967 ^
9955ddc ^



439e15d ^




16c67f3 ^
9955ddc ^

439e15d ^

0464e42 ^
439e15d ^


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