With recent releases of Ubuntu (in particular) the TrayIcon no longer works.
Original Reporter info from Mantis: dbannon @davidbannon
-
Reporter name: David
Original Reporter info from Mantis: dbannon @davidbannon
- Reporter name: David
Description:
With recent releases of Ubuntu (in particular) the TrayIcon no longer works. Attached is a patch that fixes that problem by allowing the TrayIcon to use the (Unity inspired) libappindicator3 that is shipped with most Debian based distributions.
This patch does not solve the problem for other Gnome 3 based distributions that don't install libappindicator. End users can resort to a number of Gnome Extensions (and the patch will help) but thats not a good solution.
But at least, with this patch, TrayIcon works again for a good percentage of Linux Users. And does no harm to the rest.
Steps to reproduce:
Any distro based on Ubuntu 17.10 or later. Put a TrayIcon on a form, set its icon and call show.
The small icon that should be visible top right (or, stupidly when mouse was moved to bottom left side) does not show.
Additional information:
Attached is a patch that allows the TrayIcon to use the (Unity inspired) libappindicator3 that is shipped with most Debian based distributions.
I have determined that Ubuntu based systems with libappindicator installed do work OK with the SystemTray model. However, later ones that have libappindicator3 alone do not support the System Tray model and our apps need to use the AppIndicator model instead.
Support for the Unity model has been in the LCL for some time but is limited to desktops that identify themselves as Unity. With this patch, we'll assume if only libappindicator3 is present, we should try to load it. If that loading fails, or expected functions are not found, behavior will revert to previous so we are no worse off than before.
The patch changes only unitywsctrls.pas and should be run in lcl/interfaces/gtk2.
The patch does not change how the unit works, just how it decides if it should or should not take over the TrayIcon process.
Has been tested with -
Ubuntu Mate 16.04 - does not use or need patch, OK
Ubuntu Mate 17.04 - does not use or need patch, OK
Ubuntu 17.10 - needs patch, OK
Ubuntu 18.04 - needs patch, OK.
Ubuntu 18.04 with Topicons installed - does not need, does use, OK
Xubuntu 18.04 - needs patch, OK
Debian 9.1 xfce - does not use or need patch, OK
Mantis conversion info:
- Mantis ID: 33778
- OS: Linux
- OS Build: eg Ubuntu
- Platform: x86
- Version: 1.9 (SVN)
- Fixed in revision: r58021 (#d816f49f)