antler119 / system_tray

A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Icon not showing in tray when app packaged using Flatpak

KRTirtho opened this issue · comments

The icon shows everywhere except when the app was packaged as Flatpak
Everything works just as expected just the icon doesn't show up instead there's an empty space (KDE/XFCE/Mint) or triple dots (Gnome/Budgie) which are default placeholders ig

I tried to debug but unfortunately no luck

Related issue from another project: KRTirtho/spotube#541

Is it really flatpak specific? I am not getting any icon either with the spotube appimage.

The API provided by this package is a bit unfortunate for Linux users, but I think it can be easily improved.

Internally, it calls app_indicator_set_icon_full(), which signature is the following:

image

The second parameter (*icon_name) can be:

  • The literal path for the icon file on disk
  • The name of the icon (usually installed to /usr/share/icons/hicolor/*/apps/status)

Unfortunately, this package only really covers the first option.

Ideally, a new option could be introduced so that the iconPath could be forwarded to app_indicator_set_icon_full() exactly as we specify it, because right now if I try to do something like this:

await systemTray.initSystemTray(
  title: "system tray",
  iconPath: "myapp-tray"
);

The icon name in iconPath gets converted to an absolute path, e.g. something like /usr/share/myapp/data/flutter_assets/myapp-tray, which is undesired.

I can confirm that this is also an issue in snap packaging. Basically any Linux containerized packaging will cause this not to work.