mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
parent
47ebd07307
commit
ed07353834
1 changed files with 16 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue