New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set Wayland application ID #34855
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add Fixes: https://github.com/electron/electron/issues/33578
to the PR description, so that the issue gets closed automatically when your change gets merged? Might also want to add a release note because it fixes an issue that's relevant to app developers.
Could you also add a test? Maybe something like parsing the output of the logs mentioned in #33578 (comment) if there's no neater way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this issue! Also reminded me that wm_class_class
should also be fixed for wayland microsoft/vscode#129953 (comment)
Release Notes Persisted
|
I have automatically backported this PR to "18-x-y", please check out #34877 |
I have automatically backported this PR to "19-x-y", please check out #34878 |
I have automatically backported this PR to "20-x-y", please check out #34879 |
@RaisinTen I was considering adding some basic Wayland tests but I encountered some issues and I have the feeling there are some things that would need to be taken care of before being able to do that. Part of the challenge here is that, as far as I'm aware, the CI is currently configured to run all Linux tests under X11 only. On top of that, some of the existing tests are currently failing when run under Wayland. So, before getting started with writing some Wayland specific tests, these are a couple of things that would need to be fixed first:
I could try to help with some of these issues, but I would need some pointers from someone who is 1) familiar with these systems and 2) is able to provide guidance and feedback along the way.
@deepak1556 My impression was that X11 WM_CLASS vs Wayland app_idI've only looked briefly into it, but according to GNOME's recommendation, the app should "[...] set the WM_CLASS X window property to be the same as your application's But, as you've mentioned (microsoft/vscode#129953 (comment)), that's not currently the case. So, if backwards compatibility was not a concern, my suggestion would be to make both X11's Lines 119 to 124 in afd08c9
|
To my understanding, making the Wayland environment should be done in https://github.com/electron/build-images. I'm not sure who the right person is for answering your questions, maybe @MarshallOfSound and @jkleinsc because y'all have the highest number of commits on that repo? |
I think there's an issue in this in the case where an application has multiple .desktop files. For instance consider the following two desktop files: code-oss.desktop
code-oss-url-handler.desktop
(this is a real example where a separate desktop file exists in order to register a URL handler, tested by switching vscode 1.69.2 to Electron 19.0.10) In this case Electron when launched via the I'm not sure what the correct logic should be, but perhaps desktop files with |
@ReillyBrogan Apps should have specified its desktop filename with |
I'm unsure of what you mean (I'm not generally familiar with the Electron codebase, just trying to report this issue after testing the new version of Electron with a few apps) . Are you saying that that's how they should do it when the electron app is installed at the user-level? What about the case where an Electron app is packaged as a system package? The user running the app would typically not run it as a root-level process and it would not be able to modify its For instance take a look at the Arch Linux package for code-oss, it ships two desktop files in /usr/share/applications and would almost certainly run into the same issue I described after updating to Electron 19.0.10, or any other version with the fix in this PR. |
In the system package case the packager usually decides the name of the desktop file, though they may decide to use the default names provided by the application. |
Electron has an API ( |
For what it's worth, VSCode explicitly sets the But even so, my interpretation of the specs1 is that as long as the deskop file ( Footnotes |
Yes, the icon will be picked up correctly but if the user has some kind of taskbar that they've pinned the "main" desktop file to the end result will be that windows created by clicking that desktop file will not be correctly associated with the main launcher and would appear as a new entry. For instance, I'm using Plasma right now where the taskbar by default has similar behavior to the Windows 7/10/11 taskbar in that users are able to pin applications to it and running instances of those applications are automatically grouped with the pinned icon. It does seem though like this is definitely an issue on the VS Code side, so I'll bring up the issue on their tracker so they can correct the incorrect |
* refactor: extract XDG app ID logic into a method * fix: set application ID on Wayland
* refactor: extract XDG app ID logic into a method * fix: set application ID on Wayland
Description of Change
Electron versions prior to 18.0.0 (
<18.0.0
) were setting the Wayland application ID to the same value as the X11WM_CLASS
property. But in recent versions of Electron the Wayland's application ID property is empty (#33578).Most likely this was caused by this upstream Chromium change which introduced the
wayland_app_id
property.This pull-request makes use of the
wayland_app_id
property by setting its value to the basename of the application's.desktop
file.Fixes #33578
Closes #34852
Related issues
Checklist
npm test
passesRelease Notes
Notes: Fix empty app_id when running under wayland