1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
jules 2007-09-13 12:39:11 +00:00
parent 47ebd07307
commit ed07353834

View file

@ -1096,14 +1096,23 @@ public:
void setIcon (const Image& newIcon)
{
/*XWMHints* wmHints = XAllocWMHints();
wmHints->flags = IconPixmapHint | IconMaskHint;
wmHints->icon_pixmap =
wmHints->icon_mask =
const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2;
uint32* const data = (uint32*) juce_malloc (dataSize);
XSetWMHints (display, windowH, wmHints);
XFree (wmHints);
*/
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);
juce_free (data);
}
//==============================================================================