simplify xftcolor config

This commit is contained in:
okan 2019-03-04 13:33:39 +00:00
parent 9d25218458
commit 0c0551b8bf

7
conf.c
View File

@ -493,11 +493,8 @@ conf_screen(struct screen_ctx *sc)
warnx("XftColorAllocValue: %s", Conf.color[i]); warnx("XftColorAllocValue: %s", Conf.color[i]);
break; break;
} }
if (XftColorAllocName(X_Dpy, sc->visual, sc->colormap, if (!XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
Conf.color[i], &xc)) { Conf.color[i], &sc->xftcolor[i])) {
sc->xftcolor[i] = xc;
XftColorFree(X_Dpy, sc->visual, sc->colormap, &xc);
} else {
warnx("XftColorAllocName: %s", Conf.color[i]); warnx("XftColorAllocName: %s", Conf.color[i]);
XftColorAllocName(X_Dpy, sc->visual, sc->colormap, XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
color_binds[i], &sc->xftcolor[i]); color_binds[i], &sc->xftcolor[i]);