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]);
break;
}
if (XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
Conf.color[i], &xc)) {
sc->xftcolor[i] = xc;
XftColorFree(X_Dpy, sc->visual, sc->colormap, &xc);
} else {
if (!XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
Conf.color[i], &sc->xftcolor[i])) {
warnx("XftColorAllocName: %s", Conf.color[i]);
XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
color_binds[i], &sc->xftcolor[i]);