TrayItem - Position Information!


I’m adding a trayitem to both Windows/Linux Mint. Anyone have any ideas how to extract the position of the generated trayitem? I want to throw a window on the screen in a position relative to the trayitem.

BTW - trayitem doesn’t seem to work on Ubuntu, anyone else seen this?


Interesting article discussing the logic :

About Linux, I suspected since the GUI differs between pure X11, KDE, Gnome and Unity, things may be a lot messier than plain and simple msdn for Windows.

It seems indeed to be the case, according to that discussion :

Yet there are there interesting links to the various APIs.

XLib could be the langua franca, but it is a C library and I have no idea how this could be addressed from Xojo :

Thanks for the info Michel - I have some reading to do!

Hi Patrick,

Is the MonkeyBreadSoftware Tray Item plugin any good for your needs on Windows -
I am using it to display info in bubbles.


For Linux, I just found some possible ways. The LR mentions the Linux TrayItem is using GtkStatusIcon so I searched for it, and found a treasure of documentation for it at

In particular, gtk_status_icon_get_geometry () seems to be exactly what you need. It is mentioned as deprecated, but since there is nothing else…

To build Linux declares, thankfully Christian Schmitz of Monkeybreadsoftware has posted the only example I know of at

There is another way that can work well. Since the tray icon will appear as the last one when you launch the app, all is needed is to detect it into the task bar. Use ScreenShotRectMBS to get the pixel color of the taskbar on the right hand side, and scan to the left until a color change. That will be where the icon right hand side is.

Interestingly enough, this method will also work on Windows.

I have used successfully a similar method on Mac with the same plugin, to detect the position of the dock that I could not find with declares.