Patch to make TrayIcon work in GTK3
Original Reporter info from Mantis: dbannon @davidbannon
-
Reporter name: David
Original Reporter info from Mantis: dbannon @davidbannon
- Reporter name: David
Description:
At present, Lazarus on GTK3 does not support the TrayIcon at all, in lcl/interfaces/gtk3/gtk3wsfactory.pas the function RegisterCustomTrayIcon() just returns false.
My patch has a slightly modified version of UnityWSCtrls.pas from GTK2 that implements AppIndicator3, a dumbed down version of the older System Tray Icon. All you can use an AppIndicator TrayIcon for is to pop up a menu but that is the way many Linux Desktops are heading anyway.
I have tested this patch on older distros such as Ubuntu16.04, newer (GTK3 only) ones such as Ubuntu19.10. On Mageia 7.1 and Linux Mint 19.2. On KDE, Xfce and Enlightenment desktops.
Steps to reproduce:
The patch is an svn patch against Lazarus Trunk r62111
Additional information:
Be aware that this is still not the approach that the Gnome Developers would like us to take. That involves their App Notifier via dbus approach. Maybe some time in the distant future ....
Note that unlike gtk2, when running on gtk3 and, for example, the LibAppIndicator3 is not installed, it will not fall back to old System Tray mode (GTK3 does not have an old System Tray mode). Programmers may well be advised to check for presence of libappindicator3 at startup or set it as a dependency. I will document this on the wiki.
Mantis conversion info:
- Mantis ID: 36209
- OS: Linux
- OS Build: Various
- Version: 2.1 (SVN)
- Fixed in revision: r62137 (#193392dc)
- Monitored by: » @davidbannon (David)