summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--client.c9
-rw-r--r--mousefunc.c4
2 files changed, 7 insertions, 6 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;
diff --git a/mousefunc.c b/mousefunc.c
index 74bbf04..fdb55fa 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -49,8 +49,8 @@ mousefunc_sweep_draw(struct client_ctx *cc)
 	int			 width, height, width_size, width_name;
 
 	snprintf(asize, sizeof(asize), "%dx%d",
-	    (cc->geom.width - cc->geom.basew) / MAX(1, cc->geom.incw),
-	    (cc->geom.height - cc->geom.baseh) / MAX(1, cc->geom.inch));
+	    (cc->geom.width - cc->geom.basew) / cc->geom.incw,
+	    (cc->geom.height - cc->geom.baseh) / cc->geom.inch);
 	width_size = font_width(asize, strlen(asize)) + 4;
 	width_name = font_width(cc->name, strlen(cc->name)) + 4;
 	width = MAX(width_size, width_name);