Ipfs-desktop: Tray Icon problems on Linux

Created on 27 Sep 2019  Â·  20Comments  Â·  Source: ipfs-shipyard/ipfs-desktop

So, there are quite a few issues with people complaining they can't access the UI of IPFS Desktop on Linux. All of them are caused by the same reason: tray icons are being deprecated from many desktop environments and Electron has not yet worked out on a solution, nor it seems to be happening soon.This affects all kinds of packages.

One possible way for us to circumvent this for now is to open the main Web UI window on Linux on startup. However, that will still leave the options of exiting desktop and other options provided by the menu behind.

I'm opening this in hope to gather feedback on how to create an workaround around this.

Please note that Linux support is experimental nonetheless.

P1 arelinux kinbug kinmaintenance neeanalysis statuin-progress

Most helpful comment

https://github.com/electron/electron/pull/23674 got merged and backported to 8.x: https://github.com/electron/electron/pull/23674#issuecomment-637876725

It seems to be the lesser evil that is here to stay for a few more years.

@rafaelramalho19 I believe upgrading to electron v8.4.1 should include the above "fix". Sooner we switch, the sooner we identify any UX regressions caused by it on various Linuxes.

All 20 comments

Hm, not a fan of this solution.

Tray icons are an important feature. The desktops missing them are just deficient, intentionally or not, and regardless of their design philosophy.

A better solution would be to open a window when clicking on the application's launcher. That way, it now gains a behavior that's intuitive (clicking on a launcher generally launches the app) and it fixes the tray icon problem rather than creating a missing tray icon problem for other Linux users.

As a first step, we can have desktop open the webui window on launch as suggested. I'm not clear on how we can show the user that the app is still running if they close the window... what happens on others apps that are long running on desktops that dont have task tray icons?

what happens on others apps that are long running on desktops that dont have task tray icons?

I don't know any long-running apps without tray icons except for command-line apps, but those don't even have desktop icons in the first place. For long-running apps with a tray icon on systems without a system tray, however, I've noticed a pattern.

  • Skype launches its UI when clicking its icon even if it's already launched in background.
  • Discord launches its UI when clicking its icon even if it's already launched in background.
  • Steam launches its UI when clicking its icon even if it's already launched in background.
  • Chrome launches its UI when clicking its icon even if it's already launched in background.
  • qBitTorrent launches its UI when clicking its icon even if it's already launched in background.
  • Teams launches its UI when clicking its icon even if it's already launched in background.
  • MSI Afterburner launches its UI when clicking its icon even if it's already launched in background.
  • GeForce Experience launches its UI when clicking its icon even if it's already launched in background.
  • IPFS-Desktop doesn't react.

None of them closes on close. They minimize on minimize and go to system tray on close.

One problem that may arise is that options in the tray app will be hidden. This can be fixed by having them accessible from inside the app as well.

...we can have desktop open the webui window on launch as suggested.

I absolutely agree, but we should do that only on Linux perhaps. And even there some issues might arise... What about those users who have IPFS Desktop setup to start up automatically when they turn on the computer? I doubt anyone wants a window to be open in those cases.

I can investigate to see if there's any way to know if the app is being launched by a startup mechanism or not.

I like your idea about doing that on only Linux @hacdias, but perhaps we should be even more specific. On the default KDE layout, for example, it has a system tray, and it works perfectly, however, on Gnome, there seems to be no tray whatsoever.

  • edit: by "perfectly" I mean just like it would on windows.

Note to self: Tray support on modern linux DE is severely broken.
Pure saddness: https://github.com/electron/electron/issues/21445

Seems that old Tray support was replaced with StatusNotifier spec, and Electron 8 switched to it, but not every DE supports it out of the box:

Electron 8 switched to it,

@chromium did and Electron v8 took it as a given thing.

@dotenorio I am afraid the code you linked is a fix for other issue (https://github.com/electron/electron/issues/22443).

I don't believe it solves the mess of Electron 8 switching to StatusNotifier and breaking Tray icon in various Linux setups as noted in https://github.com/electron/electron/issues/21445#issuecomment-565061274.

For testing purposes, I was able to get tray icon back on i3bar
with https://git.sr.ht/~steef/snixembed (a StatusNotifier→XEmbed proxy)
Unfortunately it is not something we can bundle with ipfs-desktop.

@hacdias the screenshot of Lungo app you posted in the other issue inspired me to come up with a potential workaround for Linux for next 10 years (until everyone switch to StatusNotifier :upside_down_face:):

2020-04-20--01-24-34

Idea:
What if we add "Show WebUI at Launch" feature to ipfs-desktop and enable it by default on Linux?

Rationale:

  • if user does not have the tray icon in Linux DE

    • clicking ipfs icon is "Applications" would start node and show webui

    • closing webui would keep daemon running

    • clicking "IPFS Desktop" in "Applications" again would show webui

    • downside: no controls for stopping node, but its better than clicking on icon and nothing happening

  • if user has the tray icon in their Linux DE and does not want webui to show on startup, they can disable it with one click

What if we add "Show WebUI at Launch" feature to ipfs-desktop and enable it by default on Linux?

I ended up with this scenario for Linux users of ElectronMail (ref1, ref2).

Thanks for heads up in the original issue @vladimiry!

To whom it may concern. It turned out Electron is getting rid of DBus related tray icon implementation rolled out with chromium update in Electron v8 in favor of previously used / GTK/appindicator approach, see https://github.com/electron/electron/pull/23674.

Let's reopen this and track progress in https://github.com/electron/electron/pull/23674 – if Electron indeed restores old tray support, that would be great news for our Linux users.

https://github.com/electron/electron/pull/23674 got merged and backported to 8.x: https://github.com/electron/electron/pull/23674#issuecomment-637876725

It seems to be the lesser evil that is here to stay for a few more years.

@rafaelramalho19 I believe upgrading to electron v8.4.1 should include the above "fix". Sooner we switch, the sooner we identify any UX regressions caused by it on various Linuxes.

  • Cinnamon / Mint: "System Settings" -> "General" -> "Enable support for indicators" flag needs to be enabled. Some issues still possible, see linuxmint/cinnamon#9176.

@lidel Some time ago Cinnamon implemented this differently and that "support for indicators" option is now gone from the settings.
(see https://github.com/linuxmint/cinnamon/commit/eb7f2235debcd3baf36d2d94a23465158b8bdafc)
Since your comment is linked from the readme, it would be nice to update that it just works.

Heads up: we are planning to switch to Electron 9 in the next release, and it will include change described in https://github.com/ipfs-shipyard/ipfs-desktop/issues/1153#issuecomment-634293717

@bertrandfalguiere thank you for testing v0.13.0 with Electron 9.x across different distros in https://github.com/ipfs-shipyard/ipfs-desktop/issues/1661 :heart:
Do you know how does the tray icon behave now? Which desktop environment were you using for tests?
Is there anything we should improve in https://github.com/ipfs-shipyard/ipfs-desktop/#no-tray-icon-on-linux ?

@lidel The tray icon behave nominally now on my system with v0.13.0 :).
I tested with Ubuntu 20.04. I don't know which app indicator I'm using. I think the default one, which should be Gnome Shell?
I haven't tested on other distros (and probably won't).

@bertrandfalguiere that is enough, thank you! I was mostly worried about Ubuntu, as historically they used custom stuff and hid tray indicators. Seems that Electron 9.x correctly supports whatever Ubuntu uses these days, so all good :+1:

This issue can be closed when v0.13 ships (#1661)

I believe this should be fixed in v0.13, but please reopen if you experience any tray problems (include info about your distro and DE/WM/tray setup)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nlko picture nlko  Â·  3Comments

Luflosi picture Luflosi  Â·  5Comments

bertrandfalguiere picture bertrandfalguiere  Â·  3Comments

svitekpavel picture svitekpavel  Â·  4Comments

lidel picture lidel  Â·  5Comments