Description
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
38
What operating system(s) are you using?
Other Linux
Operating System Version
Fedora 42
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
No
Expected Behavior
Apps should have the same wm_class (X11) and app_id (Wayland) by default. This allows desktop environments to look up the correct icons on both X11 and Wayland, based on a single .desktop file.
e.g.., an app with productName: "1Password" should have its wm_class and app_id both normalized to "1password" to correspond with a "1password.desktop" file.
It might also be a good idea to let developers specify the app_id and/or wm_class at runtime instead of relying on hard-to-understand semantics from fields in package.json.
Actual Behavior
Electron sets a lowercase wm_class but preserves the case when setting app_id, deriving both values from the same fields in package.json (productName or name). If the source value isn't already lowercase, this causes some icons not loading properly on Wayland in certain environments, e.g. KDE. An example is 1Password, which shows its icon in the taskbar icon but is unable to show it in the Alt-Tab switcher or window corner when running in native Wayland mode:
- productName: "1Password"
- derived wm_class:
1password - derived app_id:
1Password - desktop file:
1password.desktop
Testcase Gist URL
No response
Additional Information
xdg documentation: https://wayland.app/protocols/xdg-shell#xdg_toplevel:request:set_app_id
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
Activity
nikwen commentedon Sep 29, 2025
Thanks for filing this issue!
We've also had other reports of icons not working: #45638
mitchchn commentedon Oct 4, 2025
For anyone who is interested, I found a workaround: set
desktopNameinpackage.json:This sets the XDG app ID correctly to "1password".
But I still think that Electron shouldn't be using the product name at all (especially if not sanitized) to determine the app ID: product names are supposed to be human readable, capitalized and have spaces, they aren't great IDs.
mitchchn commentedon Oct 7, 2025
Related: the XDG app ID and .desktop file aren't allowed to have spaces, but they're likely to be included in an app's product name:
https://specifications.freedesktop.org/desktop-entry-spec/latest/file-naming.html?utm_source=chatgpt.com
Ideally, out of the box, given
productName: "Foo Desktop":foo-desktop.desktopwith startup classfoo-desktopfoo-desktopas both the XDG App ID and wm_classdesktopNameThis would go a long way to fixing icon problems for apps.