about summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authoroga <oga>2009-08-25 01:32:40 +0000
committeroga <oga>2009-08-25 01:32:40 +0000
commit8fd4ff1c7c4c3914e75213df9fce4c5e65cf2cd4 (patch)
treef02031bfcb2fc87d553c029bebe33777b7c27356 /client.c
parentfcb2684db1d3e102b6ff578e0e686e0e089a403a (diff)
downloadcwm-8fd4ff1c7c4c3914e75213df9fce4c5e65cf2cd4.tar.gz
cwm-8fd4ff1c7c4c3914e75213df9fce4c5e65cf2cd4.tar.xz
cwm-8fd4ff1c7c4c3914e75213df9fce4c5e65cf2cd4.zip
Instead of messing around everytime we do a resize, just clamp the
resize increments to a minimum of one, and use it unconditionally.

"you've convinced me, do it!" okan@
Diffstat (limited to 'client.c')
-rw-r--r--client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/client.c b/client.c
index 484615e..4fc244d 100644
--- a/client.c
+++ b/client.c
@@ -685,6 +685,9 @@ client_getsizehints(struct client_ctx *cc)
 		cc->geom.incw = cc->size->width_inc;
 		cc->geom.inch = cc->size->height_inc;
 	}
+	cc->geom.incw = MAX(1, cc->geom.incw);
+	cc->geom.inch = MAX(1, cc->geom.inch);
+
 	if (cc->size->flags & PAspect) {
 		if (cc->size->min_aspect.x > 0) 
 			cc->geom.mina = (float)cc->size->min_aspect.y /
@@ -725,10 +728,8 @@ client_applysizehints(struct client_ctx *cc)
 	}
 
 	/* adjust for increment value */
-	if (cc->geom.incw)
-		cc->geom.width -= cc->geom.width % cc->geom.incw;
-	if (cc->geom.inch)
-		cc->geom.height -= cc->geom.height % cc->geom.inch;
+	cc->geom.width -= cc->geom.width % cc->geom.incw;
+	cc->geom.height -= cc->geom.height % cc->geom.inch;
 
 	/* restore base dimensions */
 	cc->geom.width += cc->geom.basew;