X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=event.c;h=1a8de56b208373c5e94b7100278f5583c51c0d39;hb=95766d6241a401b3665ac1ad528b90c55e7b6810;hp=bc7d42c2a452097cf6e741c9e376374766af23d7;hpb=4cb78a170c6daa488a90dffb60224fcf2b76fbf0;p=dwm.git diff --git a/event.c b/event.c index bc7d42c..1a8de56 100644 --- a/event.c +++ b/event.c @@ -58,6 +58,7 @@ static void resizemouse(Client *c) { int ocx, ocy; + int nw, nh; Corner sticky; XEvent ev; @@ -76,8 +77,10 @@ resizemouse(Client *c) break; case MotionNotify: XSync(dpy, False); - c->w = abs(ocx - ev.xmotion.x); - c->h = abs(ocy - ev.xmotion.y); + if((nw = abs(ocx - ev.xmotion.x))) + c->w = abs(ocx - ev.xmotion.x); + if((nh = abs(ocy - ev.xmotion.y))) + c->h = abs(ocy - ev.xmotion.y); c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; if(ocx <= ev.xmotion.x)