Hello Julian,
I was confused a bit when was looking into the TaskbarIconComponent source code and its fuctionality. For me (Windows/Linux), “taskbar” is a long rectangle stuck to some edge of my working area and which is supposed to display a small rectangles (taskbar buttons) with icons and a short text description of a window’s title bar text of currently running applications.
like this:
As to TaskbarIconComponent, I think it should be renamed to something like SystemTrayIconComponent because “system tray” is a smaller area within that “taskbar” where clock or volume icon or whatever information icons reside. Exactly there where TaskbarIconComponent places icons now.
like this:
Under Windows, the application icon is automatically displayed on its taskbar button as it’s statically linked with the default icon in its resources and that is automatically associated with the whole application and with any of its top level windows by default (no need to call any API functions). Besides, Windows API has a simple way to change it by calling the ::SetIcon(HWND, HICON) function (applies to any windows, generally it’s used to set an icon in a window’s title bar).
Under Linux, there are no implicit ways to display your application associated icon on the taskbar button of your application (and at a window title bar accordingly). But you may explicitly call an API function to set it up. JUCE currently has not a way to do that. As I encountered the problem, I’ve tried to solve it. I’ve looked into the wxWidgets (wxWindows) source code as I knew it can do it. I discovered the simple way that does the thing. I love JUCE and want you to introduce the functionality in it. Here is the function that needs to be corrected a little.
[code]void Component::setWindowIcon(const Image* imageToUse)
{
LinuxComponentPeer* const peer
= dynamic_cast <LinuxComponentPeer*> (getTopLevelComponent()->getPeer());
if (peer == 0)
return;
Window windowH = (Window) peer->getNativeHandle();
if (windowH)
{
XWMHints *wmHints = XAllocWMHints();
wmHints->icon_pixmap = /*juce_createPixmapFromImage(*imageToUse);*/ //this function is not suitable for the purpose for now. It generates pixmaps with strange colours.
wmHints->flags = IconPixmapHint;
XSetWMHints(display, windowH, wmHints);
XFree(wmHints);
}
}
[/code]
P.S. JUCE doesn’t smoothly compile under Linux (x86/x86_64) since version 1.41 till 1.42. I’ve addressed the post to you 2 months ago about how to simply check for compilation problems but you’ve silently ignored it. Here was my advice as you’ve asked for: http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=1001&postdays=0&postorder=asc&highlight=m64&start=60
Under Linux:
More over, in JUCE.make you must correct the following:
juce_positionedrectangle.o -> juce_PositionedRectangle.o
juce_positionedrectangle.cpp -> juce_PositionedRectangle.cpp
More over, In InterProcessLock::~InterProcessLock() destructor (located in the juce_linux_Threads.cpp file) you must correct the following call:
close ((int) internal);
to
#if JUCE_64
close ((long long) internal);
#else
close ((int) internal);
#endif