Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
applied Sanders LD and resize patches
[dwm.git]
/
event.c
diff --git
a/event.c
b/event.c
index
bc7d42c
..
1a8de56
100644
(file)
--- a/
event.c
+++ b/
event.c
@@
-58,6
+58,7
@@
static void
resizemouse(Client *c)
{
int ocx, ocy;
resizemouse(Client *c)
{
int ocx, ocy;
+ int nw, nh;
Corner sticky;
XEvent ev;
Corner sticky;
XEvent ev;
@@
-76,8
+77,10
@@
resizemouse(Client *c)
break;
case MotionNotify:
XSync(dpy, False);
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)
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)