summary refs log tree commit diff
path: root/conf.c
diff options
context:
space:
mode:
authorokan <okan>2013-05-20 20:21:04 +0000
committerokan <okan>2013-05-20 20:21:04 +0000
commit270df196ac17363536c44fe342b4e71e1c8450e3 (patch)
tree73f285a3f099b8b96d5d7e8b8e9b297c01613842 /conf.c
parente14123210a7773a0fda562eb367d71482c872e60 (diff)
downloadcwm-270df196ac17363536c44fe342b4e71e1c8450e3.tar.gz
cwm-270df196ac17363536c44fe342b4e71e1c8450e3.tar.xz
cwm-270df196ac17363536c44fe342b4e71e1c8450e3.zip
- configure menuwin with the screen, then create the xft drawable using
  the menu window since that's the only place on which we draw
- elminate the need to change the drawable on every font draw
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/conf.c b/conf.c
index b4d5d9d..984e4cc 100644
--- a/conf.c
+++ b/conf.c
@@ -103,11 +103,6 @@ conf_screen(struct screen_ctx *sc)
 
 	sc->gap = Conf.gap;
 
-	sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
-	    sc->visual, sc->colormap);
-	if (sc->xftdraw == NULL)
-		errx(1, "XftDrawCreate");
-
 	sc->xftfont = XftFontOpenName(X_Dpy, sc->which, Conf.font);
 	if (sc->xftfont == NULL)
 		errx(1, "XftFontOpenName");
@@ -134,6 +129,16 @@ conf_screen(struct screen_ctx *sc)
 	if (!XftColorAllocValue(X_Dpy, sc->visual, sc->colormap,
 	    &xc.color, &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
 		warnx("XftColorAllocValue: '%s'", Conf.color[i]);
+
+	sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0, 1, 1,
+	    Conf.bwidth,
+	    sc->xftcolor[CWM_COLOR_MENU_FG].pixel,
+	    sc->xftcolor[CWM_COLOR_MENU_BG].pixel);
+
+	sc->xftdraw = XftDrawCreate(X_Dpy, sc->menuwin,
+	    sc->visual, sc->colormap);
+	if (sc->xftdraw == NULL)
+		errx(1, "XftDrawCreate");
 }
 
 static struct {