about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R.Garbe <arg@10ksloc.org>2006-08-14 08:43:19 +0200
committerAnselm R.Garbe <arg@10ksloc.org>2006-08-14 08:43:19 +0200
commit95766d6241a401b3665ac1ad528b90c55e7b6810 (patch)
tree09789c6cf44cbb37dba40bbe4ba3c771d9b904ef
parent4cb78a170c6daa488a90dffb60224fcf2b76fbf0 (diff)
downloaddwm-95766d6241a401b3665ac1ad528b90c55e7b6810.tar.gz
applied Sanders LD and resize patches
-rw-r--r--Makefile3
-rw-r--r--config.mk3
-rw-r--r--event.c7
3 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 9ef219a..a0bfc0c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ options:
 	@echo "CFLAGS   = ${CFLAGS}"
 	@echo "LDFLAGS  = ${LDFLAGS}"
 	@echo "CC       = ${CC}"
+	@echo "LD       = ${LD}"
 
 .c.o:
 	@echo CC $<
@@ -27,7 +28,7 @@ config.h:
 
 dwm: ${OBJ}
 	@echo LD $@
-	@${CC} -o $@ ${OBJ} ${LDFLAGS}
+	@${LD} -o $@ ${OBJ} ${LDFLAGS}
 	@strip $@
 
 clean:
diff --git a/config.mk b/config.mk
index d84b47e..2159481 100644
--- a/config.mk
+++ b/config.mk
@@ -20,5 +20,6 @@ LDFLAGS = ${LIBS}
 #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
 #LDFLAGS = -g ${LIBS}
 
-# compiler
+# compiler and linker
 CC = cc
+LD = ${CC}
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)
ef='#n199'>199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290