antler119 / system_tray

A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.
MIT License
214 stars 51 forks source link

Icon not showing in tray when app packaged using Flatpak #67

Open KRTirtho opened 1 year ago

KRTirtho commented 1 year ago

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: https://github.com/KRTirtho/spotube/issues/541

callegar commented 11 months ago

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

guihkx commented 8 months ago

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:

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.

velten-dev commented 4 months ago

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