You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Tray icon on Linux has chome id for all Electron applications (AppIndicator/StatusNotifierItem) #40936
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
28.0.0
What operating system are you using?
Other Linux
Operating System Version
Arch Linux
What arch are you using?
x64
Last Known Working Electron version
22.x
Expected Behavior
For various desktop environments to function correctly, every registered AppIndicator must have a unique, stable ID attached to the StatusNotifierItem. Prior to the migration to StatusIconLinuxDbus implementation in #36333 the application name was used as the ID prefix.
Actual Behavior
All Electron applications use the same indicator ID value of chrome_status_icon_1, which breaks the functionality of desktop environments for managing tray icons like sorting, hiding, etc.
Testcase Gist URL
No response
Additional Information
See some examples of previous times this was fixed:
Hello @pdf. Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the
blocked/need-reproNeeds a test case to reproduce the bug
label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
@codebytere I'm not an Electron developer, so I'm not sure off-hand how to write an Electron application that registers a system tray - I observed this behaviour of Electron apps when implementing an SNI host.
If it helps, here's the DBUS dialog when any Electron application registers a tray icon to the SNI host, and is queried for its SNI id property - every Electron application returns the same result (though the last digit will increase if they for some reason register multiple tray icons AIUI):
But the multiple times this has been fixed in previous implmementations of SNI as mentioned in the original issue should serve as illustration enough of the issue, no?
Reacted by Alex Red, Savely Krasovsky, Danny Trunk, Shubham Arora and Mr Beedell, Roke Julian Lockhart
most of the flathub apps on Linux that are using the electron as the app engine share the exact same issue.
@lordgreg When you say most, are you using that as an expression, or because you have not tried them all, or literally? What I am asking is, do any apps that use electron not share the same issue? I would be curious how they managed it if so.
most of the flathub apps on Linux that are using the electron as the app engine share the exact same issue.
@lordgreg When you say most, are you using that as an expression, or because you have not tried them all, or literally? What I am asking is, do any apps that use electron not share the same issue? I would be curious how they managed it if so.
I am terribly sorry that I've formulated my sentence in the doubtful way. With most I mean all Electron-based Apps that I have used or been using.
Reacted by WKoA and Mr Beedell, Roke Julian Lockhart
Personally I'd use base::StringPrintf as the previous change did. For simplicity I'd probably just leave the numeric suffix always, end users rarely see it anyway.
I can reproduce a related problem on Ubuntu MATE with mate-indicator-applet + ayatana-indicator-application-service.
Two Electron apps (Joplin, Claude Desktop) run at the same time. Both register a StatusNotifierItem with the same IconName ("status_icon_0") and differing IconThemePath (/tmp/org.chromium.Chromium.XXXXXX). Their Ids are distinct (Joplin_status_icon_1, Claude_status_icon_1), but the host resolves the icon only by name, so the app that started first wins and the second app shows the first app's icon.
GetAll on the item (Joplin):
IconName = 'status_icon_0'
IconThemePath = '/tmp/org.chromium.Chromium.rqtOO9'
Id = 'Joplin_status_icon_1'
No IconPixmap property is exposed.
Claude Desktop:
IconName = 'status_icon_0'
IconThemePath = '/tmp/org.chromium.Chromium.STdvvx'
Id = 'Claude_status_icon_1'
Closing one of the apps restores the correct icon of the other. Restarting the applet does not change it. Setting XDG_CURRENT_DESKTOP=Unity makes the app not register at all in this host.
Versions: Joplin Electron <42.11.18>, Claude Desktop Electron <45.3.3>, Ubuntu MATE <26.04.1 LTS>, MATE Desktop Environment <1.28.2>
Exposing IconPixmap, or using a per-app unique IconName (e.g. derived from the app name), would avoid the collision regardless of the host.
Activity
electron-issue-triage commentedon Jan 16, 2024
Hello @pdf. Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the blocked/need-reproNeeds a test case to reproduce the bug
label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
pdf commentedon Jan 16, 2024
@codebytere I'm not an Electron developer, so I'm not sure off-hand how to write an Electron application that registers a system tray - I observed this behaviour of Electron apps when implementing an SNI host.
If it helps, here's the DBUS dialog when any Electron application registers a tray icon to the SNI host, and is queried for its SNI
idproperty - every Electron application returns the same result (though the last digit will increase if they for some reason register multiple tray icons AIUI):But the multiple times this has been fixed in previous implmementations of SNI as mentioned in the original issue should serve as illustration enough of the issue, no?
ZenithMonk commentedon Mar 9, 2024
Any updates on the issue ?
35 remaining items
lordgreg commentedon Jul 31, 2025
Hi,
most of the flathub apps on Linux that are using the electron as the app engine share the exact same issue.
Thank you for your hard work electron devs!
Reginald-Gillespie commentedon Jul 31, 2025
@lordgreg When you say
most, are you using that as an expression, or because you have not tried them all, or literally? What I am asking is, do any apps that use electron not share the same issue? I would be curious how they managed it if so.lordgreg commentedon Jul 31, 2025
I am terribly sorry that I've formulated my sentence in the doubtful way. With most I mean all Electron-based Apps that I have used or been using.
Damglador commentedon Oct 25, 2025
Doing a bit of digging. Chrome sets seems to control properties of the entry in https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.cc which gets used in https://github.com/electron/electron/blob/main/shell/browser/ui/tray_icon_linux.cc but it probably doesn't touch the id, so chromium sets the default from
PropertyIdFromId(NextServiceId())which likely returns thatchrome_status_icon_1, and increases the id only if there are multiple icons from the same app, doesn't even try to check if it's a duplicate of another app's id:Now the only thing left is to figure out how to set that id from Electron with close to zero C++ skills.
0009-0009-1013-986X commentedon Oct 25, 2025
If it hasn't been mentioned yet, a downstream bug may exist at
bugs.kde.org/show_bug.cgi?id=470840, with diagnosis.pdf commentedon Oct 25, 2025
This has been fixed multiple times in the past, it just needs to do something there like:
https://github.com/electron/electron/pull/6145/files#diff-dbb87d19c09dc890aec5a50b3ddd39bdbf5df4e479b6bc27269ffb6e499ec93eR39
Damglador commentedon Oct 25, 2025
So basically replace
in
chrome/browser/ui/views/status_icons/status_icon_linux_dbus.ccwith something likeplus header for Browser using a patch
I think that's the easiest fix. Though, might as well remove the id at the end if it's = 1. Testing this will be fun
pdf commentedon Oct 25, 2025
Personally I'd use
base::StringPrintfas the previous change did. For simplicity I'd probably just leave the numeric suffix always, end users rarely see it anyway.Damglador commentedon Oct 27, 2025
I think I did it.
Now it returns
on my test app and
Electron_status_icon_1by defaultCompiling took like 2 days though
Fix Linux tray icon sharing ID with other Electron apps
Fix Linux tray icon sharing ID with other Electron apps (#2529)
docs(desktop): measure the Linux tray against a real SNI host
fix(desktop): make the Linux tray a native menu so the indicator works (
JazzyJack357 commentedon Nov 21, 2026
I can reproduce a related problem on Ubuntu MATE with mate-indicator-applet + ayatana-indicator-application-service.
Two Electron apps (Joplin, Claude Desktop) run at the same time. Both register a StatusNotifierItem with the same IconName ("status_icon_0") and differing IconThemePath (/tmp/org.chromium.Chromium.XXXXXX). Their Ids are distinct (Joplin_status_icon_1, Claude_status_icon_1), but the host resolves the icon only by name, so the app that started first wins and the second app shows the first app's icon.
GetAll on the item (Joplin):
IconName = 'status_icon_0'
IconThemePath = '/tmp/org.chromium.Chromium.rqtOO9'
Id = 'Joplin_status_icon_1'
No IconPixmap property is exposed.
Claude Desktop:
IconName = 'status_icon_0'
IconThemePath = '/tmp/org.chromium.Chromium.STdvvx'
Id = 'Claude_status_icon_1'
Closing one of the apps restores the correct icon of the other. Restarting the applet does not change it. Setting XDG_CURRENT_DESKTOP=Unity makes the app not register at all in this host.
Versions: Joplin Electron <42.11.18>, Claude Desktop Electron <45.3.3>, Ubuntu MATE <26.04.1 LTS>, MATE Desktop Environment <1.28.2>
Exposing IconPixmap, or using a per-app unique IconName (e.g. derived from the app name), would avoid the collision regardless of the host.