With my patch applied, setting the image to an XPM causes no color issues. Also, I believe that with the patch not applied, the XPMs are also the correct color too (the default application icon is correctly colored).
On 2/4/12, Carlos R. Mafra <[email protected]> wrote: > On Mon, 16 Jan 2012 at 19:22:14 -0500, GhostlyDeath wrote: >> On my PowerPC Debian Squeeze System, the icons are colored >> incorrectly. This patch removes the swapping of the data on Big Endian >> systems, thus causing the icons to be colored correctly. >> >> Please check the patch on your big endian systems and see if it either >> fixes or breaks things. It may only be applicable to Debian Squeeze >> systems possibly. >> >> If the attachment does not work, here is the cat of the patch: >> >> From f16fc0a89f1bf08b4eac98e3d905a6e13f929cfb Mon Sep 17 00:00:00 2001 >> From: GhostlyDeath <[email protected]> >> Date: Mon, 16 Jan 2012 19:00:16 -0500 >> Subject: [PATCH] Remove endian swap for icon image data. >> >> The data appears to already be in the native endian format. > > I think that in the case where your icons were being displayed wrongly, > they were being set from the _NET_WM_ICON hint. > > Because on http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html > you see under _NET_WM_ICON that > > This is an array of 32bit packed CARDINAL ARGB with high byte being A, > low byte being B. > > which is little-endian for RGBA, see > http://en.wikipedia.org/wiki/RGBA_color_space > > So if the above makes sense, does that mean that your icons will not > display correctly if they are being set from anything other than > _NET_WM_ICON? For example, if you set the icon manually to some .xpm. > > I didn't check if this function is called in those cases, though. > >> --- >> src/wmspec.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/src/wmspec.c b/src/wmspec.c >> index 95985db..1b4cf03 100644 >> --- a/src/wmspec.c >> +++ b/src/wmspec.c >> @@ -404,7 +404,7 @@ static RImage *makeRImageFromARGBData(unsigned long >> *data) >> >> for (imgdata = image->data, i = 2; i < size + 2; i++, imgdata += 4) { >> pixel = data[i]; >> -#if BYTE_ORDER == BIG_ENDIAN >> +#if 0//BYTE_ORDER == BIG_ENDIAN >> imgdata[2] = (pixel >> 24) & 0xff; /* A */ >> imgdata[1] = (pixel >> 16) & 0xff; /* R */ >> imgdata[0] = (pixel >> 8) & 0xff; /* G */ >> -- >> 1.7.2.5 > > > > -- > To unsubscribe, send mail to [email protected]. > -- Yeah... -- To unsubscribe, send mail to [email protected].
