diff options
author | okan | 2012-12-17 18:34:06 +0000 |
---|---|---|
committer | okan | 2012-12-17 18:34:06 +0000 |
commit | 6ff3931470534f22415baa05817ae1bc8aa22d6c (patch) | |
tree | ca07d01bc2fa19bdd96c4326973d9efbf491556a /font.c | |
parent | 7bb305fa2e37defb54ef76fc2e83cc6c997ad01b (diff) | |
download | cwm-6ff3931470534f22415baa05817ae1bc8aa22d6c.tar.gz |
stash the default screen visual and colormap in screen_ctx
Diffstat (limited to 'font.c')
-rw-r--r-- | font.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: font.c,v 1.23 2012/12/17 14:20:52 okan Exp $ + * $OpenBSD: font.c,v 1.24 2012/12/17 18:34:06 okan Exp $ */ #include <sys/param.h> @@ -55,7 +55,7 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) XRenderColor c; sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin, - DefaultVisual(X_Dpy, sc->which), DefaultColormap(X_Dpy, sc->which)); + sc->visual, sc->colormap); if (sc->xftdraw == NULL) errx(1, "XftDrawCreate"); @@ -66,9 +66,8 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) for (i = 0; i < CWM_COLOR_MENU_MAX; i++) { if (*color[i] == '\0') break; - if (!XftColorAllocName(X_Dpy, DefaultVisual(X_Dpy, sc->which), - DefaultColormap(X_Dpy, sc->which), color[i], - &sc->xftcolor[i])) + if (!XftColorAllocName(X_Dpy, sc->visual, sc->colormap, + color[i], &sc->xftcolor[i])) errx(1, "XftColorAllocName"); } if (i == CWM_COLOR_MENU_MAX) @@ -77,9 +76,8 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_BG].color, sc->xftcolor[CWM_COLOR_MENU_FG].color, &c); xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_FONT].color, c, &c); - if (!XftColorAllocValue(X_Dpy, DefaultVisual(X_Dpy, sc->which), - DefaultColormap(X_Dpy, sc->which), &c, - &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL])) + if (!XftColorAllocValue(X_Dpy, sc->visual, sc->colormap, + &c, &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL])) errx(1, "XftColorAllocValue"); } |