Make sniqt recognize all tray abilities (or create a working indicator in Qt)

There is this old thread of mine: How do I create a working indicator with Qt/C++? where I was suggested to use the QSystemTray library for making a tray icon in Ubuntu for my application.

Sniqt is a program that takes care of the rest. As known, Ubuntu has got rid of tray icons. Instead, it now uses indicators and only indicators. Sniqt converts the Qt tray icons into working indicators.

The problem is that it doesn't do a very decent convertion. Actions like single click, middle click etc do not work, while they do in systems that support tray icons.

Is there a way to have these actions back? Can I use QSystemTray icon and still have these interesting (and very helpful, in my occasion) actions in Ubuntu?

I would be glad to know the answer to the other thread I talked about earlier (how to make a working indicator using the GTK libraries and prevent the crash), as well.

Link for Sniqt bug: https://bugs.launchpad.net/sni-qt/+bug/1027652


Unity, by choice, doesn't support what you are referring to as "decent tray icons". It's indicators or nothing. From there you have several options:

  • Make do with the limited indicator capabilities. You can set the menu that will by used by your indicator with the standard QSystemTray.setContextMenu() method.

  • Detach your app from the systray entirely. As in, turn it into a floating icon on the desktop, that will be able to accept middle- and right-clicks as God and Matthias Ettrich intended. You can find a simple example of how to do this here: http://kde-apps.org/content/show.php/KEyes?content=51493 (Optionally, do this only when you detect that you are running under Unity, i.e. if $DESKTOP_SESSION is set to 'ubuntu'.)

  • Declare Unity unsupported. This is not a very good option.

Whether you'll want to go with option 1 or 2 mainly depends on what your application does.