summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2017-04-26 21:10:54 +0000
committerokan <okan>2017-04-26 21:10:54 +0000
commit4d85e2e2a606f822f84fff544ec375270c44be34 (patch)
tree378ef684e97a7da5e53417ec500db31447e200fc
parent15b9a8fe27a72e58f1fb488ebf14c3fcae4b98a9 (diff)
downloadcwm-4d85e2e2a606f822f84fff544ec375270c44be34.tar.gz
cwm-4d85e2e2a606f822f84fff544ec375270c44be34.tar.xz
cwm-4d85e2e2a606f822f84fff544ec375270c44be34.zip
Switch bwidth type; unfortunately X11 is inconsistent.
-rw-r--r--calmwm.h2
-rw-r--r--client.c10
-rw-r--r--parse.y2
3 files changed, 7 insertions, 7 deletions
diff --git a/calmwm.h b/calmwm.h
index 2912662..89e24a0 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -119,7 +119,7 @@ struct client_ctx {
 	struct group_ctx	*gc;
 	Window			 win;
 	Colormap		 colormap;
-	unsigned int		 bwidth; /* border width */
+	int			 bwidth; /* border width */
 	struct geom		 geom, savegeom, fullgeom;
 	struct {
 		long		 flags;	/* defined hints */
diff --git a/client.c b/client.c
index c16e10f..e013d30 100644
--- a/client.c
+++ b/client.c
@@ -545,7 +545,7 @@ client_draw_border(struct client_ctx *cc)
 	if (cc->flags & CLIENT_URGENCY)
 		pixel = sc->xftcolor[CWM_COLOR_BORDER_URGENCY].pixel;
 
-	XSetWindowBorderWidth(X_Dpy, cc->win, cc->bwidth);
+	XSetWindowBorderWidth(X_Dpy, cc->win, (unsigned int)cc->bwidth);
 	XSetWindowBorder(X_Dpy, cc->win, pixel);
 }
 
@@ -743,13 +743,13 @@ client_placecalc(struct client_ctx *cc)
 		wmax = DisplayWidth(X_Dpy, sc->which);
 		hmax = DisplayHeight(X_Dpy, sc->which);
 
-		if (cc->geom.x + ((int)cc->bwidth * 2) >= wmax)
+		if (cc->geom.x + (cc->bwidth * 2) >= wmax)
 			cc->geom.x = wmax - (cc->bwidth * 2);
-		if (cc->geom.x + cc->geom.w - ((int)cc->bwidth * 2) < 0)
+		if (cc->geom.x + cc->geom.w - (cc->bwidth * 2) < 0)
 			cc->geom.x = -cc->geom.w;
-		if (cc->geom.y + ((int)cc->bwidth * 2) >= hmax)
+		if (cc->geom.y + (cc->bwidth * 2) >= hmax)
 			cc->geom.y = hmax - (cc->bwidth * 2);
-		if (cc->geom.y + cc->geom.h - ((int)cc->bwidth * 2) < 0)
+		if (cc->geom.y + cc->geom.h - (cc->bwidth * 2) < 0)
 			cc->geom.y = -cc->geom.h;
 	} else {
 		struct geom		 area;
diff --git a/parse.y b/parse.y
index 2c358ea..0c9606a 100644
--- a/parse.y
+++ b/parse.y
@@ -116,7 +116,7 @@ main		: FONTNAME STRING		{
 			conf->stickygroups = $2;
 		}
 		| BORDERWIDTH NUMBER {
-			if ($2 < 0 || $2 > UINT_MAX) {
+			if ($2 < 0 || $2 > INT_MAX) {
 				yyerror("invalid borderwidth");
 				YYERROR;
 			}