TTrayIcon with Lazarus 2.2+ on Linux with Mate lazarus / 32-Linux ---------------------------------------------------------------------- mhart · 2021-11-09 12:09 Hi, Could you please advise me some way how to display an icon on system tray (Fedora 35 with Mate desktop). It was possible building app with Lazarus 2.0.12 GTK2, but this option is no longer supported by Lazarus 2.2+. Thanks. ---------------------------------------------------------------------- JuhaManninen · 2021-11-09 13:19 Quote from: mhart on November 09, 2021, 01:09:09 pmHi, Could you please advise me some way how to display an icon on system tray (Fedora 35 with Mate desktop). It was possible building app with Lazarus 2.0.12 GTK2, but this option is no longer supported by Lazarus 2.2+. It is supported, even better than before. Explain more please. ---------------------------------------------------------------------- mhart · 2021-11-09 13:33 An app built with Lazarus 2.0.12 displays icon on system tray perfectly, but the same app built with Lazarus 2.2 RC1 or RC2 does not display the icon. I try it on ubuntu 21.10 and no icon as well, but if app was built with Lazarus 2.0.12 it works perfectly. At Lazarus Wiki about TTrayIcon says the behavior was changed in Lazarus 2.2. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-11-09 15:27 Hey MHart, Could you please tell us if you attached a TPopUpMenu to the TTrayIcon ? ATM I'm upgrading Ubuntu boxes and after that I'm finally gonna start on my TestTrayIcon app that I've been putting off for a while. I'm gonna host it on GitHub, so I'll link it here if I get any answers to this question. As you can see by my signature I'm on Ubuntu 21.10 also. Cheers, Gus ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-11-09 15:33 Hey MHart, BTW, when I get some answers for myself I'll also update this thread: Why did the Tray Icon stop working with Ubuntu?. I started it quite a while ago and then planned the TestTrayIcon project but never got around to get to it. So I'll keep both threads updated on my progress. In the mean time have a read an try to see if any of the info already relayed on that thread can help you. Cheers, Gus ---------------------------------------------------------------------- mhart · 2021-11-09 16:29 Hey Gustavo, I attached a popupmenu to TTrayIcon and the icon is there, perfect! Without attached popupmenu the icon appears if libindicator-gtk3 is removed and libindicator-gtk2 installed, but Lazarus 2.0.12 works perfectly in any case. Thank you, Mhart. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-11-09 16:53 Hey Mhart, Quote from: mhart on November 09, 2021, 05:29:40 pmI attached a popupmenu to TTrayIcon and the icon is there, perfect! Without attached popupmenu the icon appears if libindicator-gtk3 is removed and libindicator-gtk2 installed, but Lazarus 2.0.12 works perfectly in any case. Yeah, it was mentioned on the other thread I started, something about the fact that now we need to have a TPopUpMenu for it to work. What I wasn't aware is that you didn't need it on 2.0.12. Need to get all that info in my TestTrayIcon project. Quote from: mhart on November 09, 2021, 05:29:40 pmThank you, You are most welcome!! Cheers, Gus ---------------------------------------------------------------------- JuhaManninen · 2021-11-09 19:39 See  https://wiki.lazarus.freepascal.org/How_to_use_a_TrayIcon LAZUSEAPPIND=NO environment variable may be useful. ---------------------------------------------------------------------- dbannon · 2021-11-10 01:20 In the "new" but not necessarily "better" model, a tray icon MUST have a popup menu and does not return, as separate events things like double click, drag, right click. Desktops like Mate do still support the old, richer, system tray model but there is no guarantee that they will even the next release. So, you are well advised to design your apps to use only the new model. (Sadly) most of your linux end users will be using Gnome (no, I don't know why) and it will not display the old model at all. And, for the record, most newly released distros right now, on Gnome are using libayatana-appindicator3 rather than libappindicator3. Lazarus less than 2.2.* (or trunk) does not know about libayanta !  So, fail. I am experimenting with a postinst script that creates a symlink, do not like it, but ... EDIT: I should have mentioned one of the reasons why the old systray model will disappear is Wayland. Right now, its Gnome on Wayland, but the others are expected to follow. Davo