aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-09-29 11:23:34 +0200
committerChristoph Lohmann <20h@r-36.net>2012-09-29 11:23:34 +0200
commite49660213594faa5a79d71087bcf4ac80be22c47 (patch)
treef95b88dc3043faeba9fc6f17877364204e8916bb
parent15cd4ff84a1d6a1e316324278619df197fc2d6fd (diff)
downloadst-e49660213594faa5a79d71087bcf4ac80be22c47.tar.gz
st-e49660213594faa5a79d71087bcf4ac80be22c47.tar.bz2
We need all the colors to be available, so die() on some not available.
This is a new opportunity to see if X11 somewhen handled colors in a strange way.
-rw-r--r--st.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/st.c b/st.c
index ab8540c..5ed3753 100644
--- a/st.c
+++ b/st.c
@@ -1915,17 +1915,12 @@ xloadcols(void) {
int i, r, g, b;
XRenderColor xft_color = { .alpha = 0 };
- /* load default white color */
- if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[256], &dc.xft_col[256]))
- die("Could not allocate color '%s'\n", colorname[256]);
-
/* load colors [0-15] colors and [256-LEN(colorname)[ (config.h) */
for(i = 0; i < LEN(colorname); i++) {
if(!colorname[i])
continue;
if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.xft_col[i])) {
- dc.xft_col[i] = dc.xft_col[256];
- fprintf(stderr, "Could not allocate color '%s'\n", colorname[i]);
+ die("Could not allocate color '%s'\n", colorname[i]);
}
}
@@ -1937,8 +1932,7 @@ xloadcols(void) {
xft_color.green = g == 0 ? 0 : 0x3737 + 0x2828 * g;
xft_color.blue = b == 0 ? 0 : 0x3737 + 0x2828 * b;
if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &xft_color, &dc.xft_col[i])) {
- dc.xft_col[i] = dc.xft_col[256];
- fprintf(stderr, "Could not allocate color %d\n", i);
+ die("Could not allocate color %d\n", i);
}
i++;
}