summaryrefslogtreecommitdiffstats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'event.c')
-rw-r--r--event.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/event.c b/event.c
index bc7d42c..1a8de56 100644
--- a/event.c
+++ b/event.c
@@ -58,6 +58,7 @@ static void
58resizemouse(Client *c) 58resizemouse(Client *c)
59{ 59{
60 int ocx, ocy; 60 int ocx, ocy;
61 int nw, nh;
61 Corner sticky; 62 Corner sticky;
62 XEvent ev; 63 XEvent ev;
63 64
@@ -76,8 +77,10 @@ resizemouse(Client *c)
76 break; 77 break;
77 case MotionNotify: 78 case MotionNotify:
78 XSync(dpy, False); 79 XSync(dpy, False);
79 c->w = abs(ocx - ev.xmotion.x); 80 if((nw = abs(ocx - ev.xmotion.x)))
80 c->h = abs(ocy - ev.xmotion.y); 81 c->w = abs(ocx - ev.xmotion.x);
82 if((nh = abs(ocy - ev.xmotion.y)))
83 c->h = abs(ocy - ev.xmotion.y);
81 c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; 84 c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
82 c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; 85 c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
83 if(ocx <= ev.xmotion.x) 86 if(ocx <= ev.xmotion.x)