mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
- 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
This commit is contained in:
15
conf.c
15
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 {
|
||||
|
Reference in New Issue
Block a user