setIcon on x64


#1

Hi Jules,

The LinuxComponentPeer::setIcon function should store the data in an array of unsigned long instead of uint32 :

     [code]const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2;
    unsigned long* const data = (unsigned long*) juce_malloc (dataSize * sizeof (unsigned long));

int index = 0;
data[index++] = newIcon.getWidth();
data[index++] = newIcon.getHeight();

    for (int y = 0; y < newIcon.getHeight(); ++y)
        for (int x = 0; x < newIcon.getWidth(); ++x)
            data[index++] = newIcon.getPixelAt (x, y).getARGB();

    XChangeProperty (display, windowH,
                     XInternAtom (display, "_NET_WM_ICON", False),
                     XA_CARDINAL, 32, PropModeReplace,
                     (unsigned char*) data, dataSize);

[/code]

(the comment in this mail explains why one has to store the data in unsigned longs: http://lists.freedesktop.org/archives/xdg/2009-January/010165.html )


#2

Thanks!


#3

Hi Jules,

Apparently this issue is back in the latest tip ! (need to use a HeapBlock instead of HeapBlock)


#4

Thanks!