aboutsummaryrefslogtreecommitdiffstats
path: root/mousefunc.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mousefunc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/mousefunc.c b/mousefunc.c
index 047b825..c351e72 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: mousefunc.c,v 1.106 2016/09/28 15:54:54 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.107 2016/09/28 17:06:33 okan Exp $
*/
#include <sys/types.h>
@@ -39,16 +39,22 @@ mousefunc_sweep_draw(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
char s[14]; /* fits " nnnn x nnnn \0" */
+ XGlyphInfo extents;
(void)snprintf(s, sizeof(s), " %4d x %-4d ", cc->dim.w, cc->dim.h);
+ XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)s,
+ strlen(s), &extents);
+
XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,
- xu_xft_width(sc->xftfont, s, strlen(s)), sc->xftfont->height);
+ extents.xOff, sc->xftfont->height);
XMapWindow(X_Dpy, sc->menuwin);
XClearWindow(X_Dpy, sc->menuwin);
- xu_xft_draw(sc, s, CWM_COLOR_MENU_FONT, 0, sc->xftfont->ascent + 1);
+ XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor[CWM_COLOR_MENU_FONT],
+ sc->xftfont, 0, sc->xftfont->ascent + 1,
+ (const FcChar8*)s, strlen(s));
}
void