TaskBar or SystemTray?


#1

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


#2

Hi there

Ok, good point about the naming - I probably should change that to make it clearer.

Ta for the linux code, I’ll check that out next time I’m doing some linux stuff. And sorry for missing your other post - I just didn’t see it. Will address those issues now!


#3

[quote=“Ptomaine”]
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.[/quote]

yeah you right about the name. anyway i just finished implementing the TaskbarIconComponent in linux. it works in kde, and i think it will work on gnome too (and xfce) but i need you to test this until i come home and get my hands on my gnome machine…

until jules will approve for the main trunk, here are the changes (i’ve a more cleaned up version here but i’m too lazy to update the zip now)

TaskbarIconComponentLinux.zip


#4

[quote=“kraken”]… i need you to test this until i come home and get my hands on my gnome machine…

until jules will approve for the main trunk, here are the changes (i’ve a more cleaned up version here but i’m too lazy to update the zip now)

TaskbarIconComponentLinux.zip[/quote]

I’d love to, kraken, but I cannot download your zip file. The file size is 0 bytes in length after downloading. I have no ideas what’s the problem… :cry:


#5

ops, something has gone bad during upload. now fixed


#6

Ok, downloaded.


#7

:smiley: Hooray!!!

It works in gnome!!! (icon, pop-up menu)

Thanks, kraken. You’re the master 8)


#8

[quote=“Ptomaine”]:smiley: Hooray!!!
It works in gnome!!! (icon, pop-up menu)
[/quote]

i’m glad it worked :smiley:

anyway it is time to move along and try to realize how to use the xcomposite extension for xorg, so we will be able to have real transparencies on a linux desktop…


#9