electron: [Bug]: Tray icon missing on Ubuntu Unity 22.04 & 23.04 etc.
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
17.0.0
What operating system are you using?
Ubuntu
Operating System Version
Ubuntu Unity 22.04 and 23.04
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Tray icon should show for latest apps using Electron, like Slack, Signal and Discord.
Actual Behavior
Tray icon not shown for latest apps using Electron, like Slack, Signal and Discord.
Testcase Gist URL
No response
Additional Information
Currently, Unity7 in Ubuntu Unity 22.04 / 23.04:
$ echo $XDG_CURRENT_DESKTOP
Unity:Unity7:ubuntu
as a workaround, apps using Electron need to be started with XDG_CURRENT_DESKTOP=Unity7 or XDG_CURRENT_DESKTOP="" (unset) for the tray icon to show in Unity7 in Ubuntu.
example:
$ XDG_CURRENT_DESKTOP=Unity7 slack
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 24 (2 by maintainers)
I ran into this issue as well and had a bit of a dig around.
I tested it with an Electron 24.6.2 app (teams-for-linux) on Ubuntu Unity 23.04. Paradoxically the tray icons seem to work whenever XDG_CURRENT_DESKTOP is set to a value that Electron does not recognise as Unity.
In file lib/browser/init.ts, there is the function currentPlatformSupportsAppIndicator() If it returns true, XDG_CURRENT_DESKTOP is set to “Unity”.
Looking at the implementation of currentPlatformSupportsAppIndicator(), it returns true in the following cases:
Thus, the following launch commands are examples that fail to show the tray icon:
XDG_CURRENT_DESKTOP='Unity:Unity7:ubuntu' teams-for-linuxXDG_CURRENT_DESKTOP='Unity' teams-for-linuxXDG_CURRENT_DESKTOP='ubuntu' teams-for-linuxThus, the following launch commands are examples that succeed to show the tray icon:
XDG_CURRENT_DESKTOP='' teams-for-linuxXDG_CURRENT_DESKTOP='sadfasdfasdfa' teams-for-linuxUbuntu Unity 23.04 uses the value
XDG_CURRENT_DESKTOP='Unity:Unity7:ubuntu'which is amongst the failing examples.Bump
bump
still happening
Can confirm that @kaymes workaround works me using discord on Ubuntu 22.04 with Unity as desktop environment
My mistake… It actually affects latest version of slack-desktop debian package installed on Ubuntu Unity 23.04 which is:
So, at least I demonstrate it affects Electron/24.2.0
It was also reported to also affect latest versions of
SignalandDiscordapps on Ubuntu Unity 22.04. I will try to also demonstrate the Electron versions used with these two apps.