Recent

Author Topic: Why did the Tray Icon stop working with Ubuntu?  (Read 447 times)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 757
  • Professional amateur ;-P
Why did the Tray Icon stop working with Ubuntu?
« on: October 06, 2021, 07:40:49 am »
Hey Y'all,

This has been bugging me for quite a while and I'm not sure if I ever put in words, either here or anywhere else.

For a while now the Tray Icon functionality is no longer working with the way Ubuntu handles the notification bar.

Can anyone tell me what broke and if there's a way to make it come back from the dead again?
Is it related to DBus?

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

dbannon

  • Hero Member
  • *****
  • Posts: 1583
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Why did the Tray Icon stop working with Ubuntu?
« Reply #1 on: October 06, 2021, 08:54:09 am »
Have you read the wiki page on the topic ?  https://wiki.freepascal.org/How_to_use_a_TrayIcon

Which desktop are you referring to ? Just a guess, Gnome ?

I have noted an issue in the current beta of U21.10 with Gnome and I have reported it on Launchpad. Previous Ubuntu's all worked fine, they all have a patch that Ubuntu use to fix what Gnome does. But the beta appears to not have that patch but still claims it can do SysTray. Sigh....

Do please try you app setting an env variable (as described in the wiki page) like so

Code: Pascal  [Select][+][-]
  1. LAZUSEAPPIND=YES myapp <enter>

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 757
  • Professional amateur ;-P
Re: Why did the Tray Icon stop working with Ubuntu?
« Reply #2 on: October 06, 2021, 09:48:36 am »
Hey Davo,

Have you read the wiki page on the topic ?  https://wiki.freepascal.org/How_to_use_a_TrayIcon

THANKS, this entry is just what I wanted to try and find out...
I think I should've searched a bit more before just posting here  :-[

Which desktop are you referring to ? Just a guess, Gnome ?

As you can see from my sig, I'm on Ubuntu 21.04 Dark Theme, so yeah GNOME :)

I have noted an issue in the current beta of U21.10 with Gnome and I have reported it on Launchpad. Previous Ubuntu's all worked fine, they all have a patch that Ubuntu use to fix what Gnome does. But the beta appears to not have that patch but still claims it can do SysTray. Sigh....

SysTray is the one that came before AppIndicator, right?
I really need to learn how to verify which one of these two are in play!!

Do please try you app setting an env variable (as described in the wiki page) like so
Code: Bash  [Select][+][-]
  1. LAZUSEAPPIND=YES myapp <enter>

I've done a VERY quick preliminary test with an app I think has a tray icon and it didn't show.
Running it from the console, I got this:
Code: Bash  [Select][+][-]
  1. $ LAZUSEAPPIND=YES ./Noso
  2. Gtk-Message: 08:33:58.982: Failed to load module "overlay-scrollbar"
  3. APPIND Debug : Will try to force AppIndicator3
  4. APPIND Debug : AppIndicator3 has loaded True
  5.  
The app messes with the AppIndicator stuff on the background, but I still ain't getting an icon...

I guess I need to make sure my Ubuntu has all the conditions met that are listed at the Wiki entry.
I also need to make sure that the app is doing it right.
I also want to do some tests with 2.0.12 and laz-main(previous trunk).

SOOOOO, this means that I need to start a clean new project and then tick all the verification items on my list.

Davo, my man, many thanks for giving me a clear path on how to get this clear in my head :)

Cheers,
Gus

P.S.: I guess I'll mark this one as SOLVED when I can get the Icon back on. And maybe write my process in getting it there.
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

dbannon

  • Hero Member
  • *****
  • Posts: 1583
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Why did the Tray Icon stop working with Ubuntu?
« Reply #3 on: October 06, 2021, 01:31:05 pm »
As you can see from my sig, I'm on Ubuntu 21.04 Dark Theme, so yeah GNOME :)
Most of the other flavours tend to work fine, its Gnome thats the problem. And all (?) the other flavours have a dark theme.

Quote
SysTray is the one that came before AppIndicator, right?
I really need to learn how to verify which one of these two are in play!!

The GTK2 LCL unit prefers SysTray if it gets an indication that one is available. If not, it tries AppIndicator. Using that env var, LAZUSEAPPIND=INFO will tell you what its planning to use.  The problem in U21.10 is that it tells that code that it can do SysTray but, apparently, cannot.

People use the terms somewhat carelessly.  System Tray is the original model, my Ubuntu 2004 shows it fine. Most Ubuntu's do. Others, such as Fedora will only work through AppIndicator model. It does less things, just a popup menu. No different events for left and right click for example.

Quote
I've done a VERY quick preliminary test with an app I think has a tray icon and it didn't show.

AppIndicator must have a popup menu assigned, if not, no icon.

My app, in the Ubuntu repo, uses either SysTray or AppIndicator, easy test that your OS is not at fault. And it honours the LAZUSEAPPIND ....

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018