summaryrefslogtreecommitdiffstats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'event.c')
-rw-r--r--event.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/event.c b/event.c
index 05f4ac5..0f03823 100644
--- a/event.c
+++ b/event.c
@@ -70,8 +70,8 @@ movemouse(Client *c)
70 unsigned int dui; 70 unsigned int dui;
71 Window dummy; 71 Window dummy;
72 72
73 ocx = *c->x; 73 ocx = c->x;
74 ocy = *c->y; 74 ocy = c->y;
75 if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, 75 if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
76 None, cursor[CurMove], CurrentTime) != GrabSuccess) 76 None, cursor[CurMove], CurrentTime) != GrabSuccess)
77 return; 77 return;
@@ -85,8 +85,8 @@ movemouse(Client *c)
85 break; 85 break;
86 case MotionNotify: 86 case MotionNotify:
87 XSync(dpy, False); 87 XSync(dpy, False);
88 *c->x = ocx + (ev.xmotion.x - x1); 88 c->x = ocx + (ev.xmotion.x - x1);
89 *c->y = ocy + (ev.xmotion.y - y1); 89 c->y = ocy + (ev.xmotion.y - y1);
90 resize(c, False, TopLeft); 90 resize(c, False, TopLeft);
91 break; 91 break;
92 case ButtonRelease: 92 case ButtonRelease:
@@ -103,12 +103,12 @@ resizemouse(Client *c)
103 int ocx, ocy; 103 int ocx, ocy;
104 Corner sticky; 104 Corner sticky;
105 105
106 ocx = *c->x; 106 ocx = c->x;
107 ocy = *c->y; 107 ocy = c->y;
108 if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, 108 if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
109 None, cursor[CurResize], CurrentTime) != GrabSuccess) 109 None, cursor[CurResize], CurrentTime) != GrabSuccess)
110 return; 110 return;
111 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, *c->w, *c->h); 111 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
112 for(;;) { 112 for(;;) {
113 XMaskEvent(dpy, MouseMask | ExposureMask, &ev); 113 XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
114 switch(ev.type) { 114 switch(ev.type) {
@@ -118,10 +118,10 @@ resizemouse(Client *c)
118 break; 118 break;
119 case MotionNotify: 119 case MotionNotify:
120 XSync(dpy, False); 120 XSync(dpy, False);
121 *c->w = abs(ocx - ev.xmotion.x); 121 c->w = abs(ocx - ev.xmotion.x);
122 *c->h = abs(ocy - ev.xmotion.y); 122 c->h = abs(ocy - ev.xmotion.y);
123 *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w; 123 c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
124 *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h; 124 c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
125 if(ocx <= ev.xmotion.x) 125 if(ocx <= ev.xmotion.x)
126 sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft; 126 sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft;
127 else 127 else
@@ -203,13 +203,13 @@ configurerequest(XEvent *e)
203 if((c = getclient(ev->window))) { 203 if((c = getclient(ev->window))) {
204 gravitate(c, True); 204 gravitate(c, True);
205 if(ev->value_mask & CWX) 205 if(ev->value_mask & CWX)
206 *c->x = ev->x; 206 c->x = ev->x;
207 if(ev->value_mask & CWY) 207 if(ev->value_mask & CWY)
208 *c->y = ev->y; 208 c->y = ev->y;
209 if(ev->value_mask & CWWidth) 209 if(ev->value_mask & CWWidth)
210 *c->w = ev->width; 210 c->w = ev->width;
211 if(ev->value_mask & CWHeight) 211 if(ev->value_mask & CWHeight)
212 *c->h = ev->height; 212 c->h = ev->height;
213 if(ev->value_mask & CWBorderWidth) 213 if(ev->value_mask & CWBorderWidth)
214 c->border = 1; 214 c->border = 1;
215 gravitate(c, False); 215 gravitate(c, False);