On Mon, Oct 27, 2008 at 12:46:53PM +0100, Frank Schmitt <[EMAIL PROTECTED]> 
wrote:
> > - the code seems to be broken - _NET_WM_ICON expects cardinals, and thus
> >   an array of longs, but you seem to pass in two int's followed by bytes?
> >   you would need to fix this.
> 
> I'm rather sure this is correct. The arguments are two integers
> specifying width and height of the image followed by the image data, 4
> bytes per Pixel (ARGB). However I will have one more look at it.

The point is that cardinals are specified using *longs*, while you
currently pass in *ints*. longs have 64 bits on current hardware, ints
have 32 bits, so the property would end up corrupted.

> > - similarly, are you sure there isn't any endianness issue in the 
> > conversion?
> >   does it really work on big-endian systems?
> 
> The conversion is done completely by afterimage and I map the converted
> bytes 1-to-1 to the byte array for X. However I will try the code on a
> non-Intel Mac.

Again, the problem is that XChangeProperty expects *longs*, not *bytes*.

I think it was immensely idiotic to define _NET_WM_ICON as cardinals, but
you somehow need to pad your ints to longs, and the same for the image
data, which must be expressed in longs as well (requiring both endianness
correction and padding from 4 unsigned chars to longs, which are usually 8
bytes in size).

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [EMAIL PROTECTED]
      -=====/_/_//_/\_,_/ /_/\_\

_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to