about summary refs log tree commit diff
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan <okan>2013-05-02 17:25:15 +0000
committerokan <okan>2013-05-02 17:25:15 +0000
commit5acf6c147f88233c477e6f87ca94c45d8475ac73 (patch)
treebfa4adc3e3a48f6adb5f7deef2e70ea4f94e546c /mousefunc.c
parent5ab3b373d39c333de5774a9503c450fc9fccd814 (diff)
downloadcwm-5acf6c147f88233c477e6f87ca94c45d8475ac73.tar.gz
cwm-5acf6c147f88233c477e6f87ca94c45d8475ac73.tar.xz
cwm-5acf6c147f88233c477e6f87ca94c45d8475ac73.zip
no need for font_{ascent,descent,height} wrappers; limit font_width to
just requiring xftfont.
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mousefunc.c b/mousefunc.c
index 878f63a..be1d24a 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -55,23 +55,24 @@ mousefunc_sweep_draw(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = cc->sc;
 	char			 asize[10]; /* fits "nnnnxnnnn\0" */
-	int			 width, width_size, width_name;
+	int			 width, width_size, width_name, height;
 
 	(void)snprintf(asize, sizeof(asize), "%dx%d",
 	    (cc->geom.w - cc->hint.basew) / cc->hint.incw,
 	    (cc->geom.h - cc->hint.baseh) / cc->hint.inch);
-	width_size = font_width(sc, asize, strlen(asize)) + 4;
-	width_name = font_width(sc, cc->name, strlen(cc->name)) + 4;
+	width_size = font_width(sc->xftfont, asize, strlen(asize)) + 4;
+	width_name = font_width(sc->xftfont, cc->name, strlen(cc->name)) + 4;
 	width = MAX(width_size, width_name);
+	height = sc->xftfont->height + 1;
 
 	XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
-	XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0, width, font_height(sc) * 2);
+	XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0, width, height * 2);
 	XMapWindow(X_Dpy, sc->menuwin);
 	XClearWindow(X_Dpy, sc->menuwin);
 	font_draw(sc, cc->name, strlen(cc->name), sc->menuwin, 0,
-	    2, font_ascent(sc) + 1);
+	    2, sc->xftfont->ascent + 1);
 	font_draw(sc, asize, strlen(asize), sc->menuwin, 0,
-	    width / 2 - width_size / 2, font_height(sc) + font_ascent(sc) + 1);
+	    width / 2 - width_size / 2, height + sc->xftfont->ascent + 1);
 }
 
 void