From 774c34a381d8322bbddd01789b227080e1df1bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Thu, 6 Sep 2012 15:23:28 +0200 Subject: [PATCH] screensaver: fix decoding of transparency in xpm files Use 0 as transparent pixel. This is needed when using premultiplied alpha. --- clients/wscreensaver-glue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/wscreensaver-glue.c b/clients/wscreensaver-glue.c index a5485994..55d0a8c7 100644 --- a/clients/wscreensaver-glue.c +++ b/clients/wscreensaver-glue.c @@ -80,14 +80,14 @@ read_xpm_color(uint32_t *ctable, const char *line) value = strtol(&cstr[1], &end, 16); if (strcmp(cstr, "None") == 0) - ctable[key] = 0x00ffffff; + ctable[key] = 0x00000000; else if (cstr[0] != '#' || !(cstr[1] != '\0' && *end == '\0')) { fprintf(stderr, "%s: error interpreting XPM color '%s'\n", progname, cstr); return; + } else { + ctable[key] = value | 0xff000000; } - - ctable[key] = value | 0xff000000; } static void