about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c11
-rw-r--r--event.c2
-rw-r--r--mouse.c12
-rw-r--r--wm.h14
4 files changed, 15 insertions, 24 deletions
diff --git a/client.c b/client.c
index e05fdd7..c11d5d5 100644
--- a/client.c
+++ b/client.c
@@ -70,8 +70,7 @@ manage(Window w, XWindowAttributes *wa)
 	c->r[RFloat].y = wa->y;
 	c->r[RFloat].width = wa->width;
 	c->r[RFloat].height = wa->height;
-	c->border = wa->border_width;
-	XSetWindowBorderWidth(dpy, c->win, 0);
+	XSetWindowBorderWidth(dpy, c->win, 1);
 	XSelectInput(dpy, c->win, CLIENT_MASK);
 	XGetTransientForHint(dpy, c->win, &c->trans);
 	if(!XGetWMNormalHints(dpy, c->win, &c->size, &msize) || !c->size.flags)
@@ -97,7 +96,11 @@ manage(Window w, XWindowAttributes *wa)
 	c->snext = stack;
 	stack = c;
 	XMapWindow(dpy, c->win);
-	XGrabButton(dpy, AnyButton, Mod1Mask, c->win, False, ButtonPressMask,
+	XGrabButton(dpy, Button1, Mod1Mask, c->win, False, ButtonPressMask,
+			GrabModeAsync, GrabModeSync, None, None);
+	XGrabButton(dpy, Button2, Mod1Mask, c->win, False, ButtonPressMask,
+			GrabModeAsync, GrabModeSync, None, None);
+	XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask,
 			GrabModeAsync, GrabModeSync, None, None);
 	focus(c);
 }
@@ -116,7 +119,7 @@ resize(Client *c)
 	e.y = c->r[RFloat].y;
 	e.width = c->r[RFloat].width;
 	e.height = c->r[RFloat].height;
-	e.border_width = c->border;
+	e.border_width = 0;
 	e.above = None;
 	e.override_redirect = False;
 	XSelectInput(dpy, c->win, CLIENT_MASK & ~StructureNotifyMask);
diff --git a/event.c b/event.c
index ad4a16b..b8b39a4 100644
--- a/event.c
+++ b/event.c
@@ -86,8 +86,6 @@ configurerequest(XEvent *e)
 			c->r[RFloat].width = ev->width;
 		if(ev->value_mask & CWHeight)
 			c->r[RFloat].height = ev->height;
-		if(ev->value_mask & CWBorderWidth)
-			c->border = ev->border_width;
 	}
 
 	wc.x = ev->x;
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;
diff --git a/wm.h b/wm.h
index 7ee6103..b647a3e 100644
--- a/wm.h
+++ b/wm.h
@@ -13,19 +13,6 @@
 
 typedef struct Client Client;
 typedef struct Key Key;
-typedef enum Align Align;
-
-enum Align {
-	NORTH = 0x01,
-	EAST  = 0x02,
-	SOUTH = 0x04,
-	WEST  = 0x08,
-	NEAST = NORTH | EAST,
-	NWEST = NORTH | WEST,
-	SEAST = SOUTH | EAST,
-	SWEST = SOUTH | WEST,
-	CENTER = NEAST | SWEST
-};
 
 /* atoms */
 enum { WMProtocols, WMDelete, WMLast };
@@ -40,7 +27,6 @@ enum { RFloat, RGrid, RLast };
 struct Client {
 	char name[256];
 	char tag[256];
-	unsigned int border;
 	int proto;
 	Bool fixedsize;
 	Window win;
ager: use Direction object in move()' href='/akspecs/ranger/commit/ranger/ext/direction.py?h=v1.9.0b1&id=a406a33dd9808f1a7e57ec96ca02423caf9cfc46'>a406a33d ^
dcb079cb ^










a406a33d ^
54ea4a29 ^












a406a33d ^







748d38ca ^

a406a33d ^




37899948 ^
f66939e5 ^
656c2bf6 ^
f66939e5 ^


656c2bf6 ^
f99b82c1 ^
656c2bf6 ^
f99b82c1 ^
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144