diff options
author | okan <okan> | 2016-09-28 17:06:33 +0000 |
---|---|---|
committer | okan <okan> | 2016-09-28 17:06:33 +0000 |
commit | 92b81d3df5d28e86e849a414eb9bc6cebe0c5f3f (patch) | |
tree | f8c45854c2b8b6666100b6aa602c80d582f0796a /mousefunc.c | |
parent | b32989d3793bf0247cd517bf232799f12b5652ab (diff) | |
download | cwm-92b81d3df5d28e86e849a414eb9bc6cebe0c5f3f.tar.gz cwm-92b81d3df5d28e86e849a414eb9bc6cebe0c5f3f.tar.xz cwm-92b81d3df5d28e86e849a414eb9bc6cebe0c5f3f.zip |
Inline Xft draw and extents wrappers; too much abstraction.
Diffstat (limited to 'mousefunc.c')
-rw-r--r-- | mousefunc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mousefunc.c b/mousefunc.c index 42b7fb1..3366bf1 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -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 |