Skip to content
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

[Bug]: WM_CLASS is not set on wayland #34928

Closed
3 tasks done
harmathy opened this issue Jul 15, 2022 · 8 comments
Closed
3 tasks done

[Bug]: WM_CLASS is not set on wayland #34928

harmathy opened this issue Jul 15, 2022 · 8 comments

Comments

@harmathy
Copy link

harmathy commented Jul 15, 2022

Preflight Checklist

Electron Version

19.0.8

What operating system are you using?

Other Linux

Operating System Version

ArchLinux

What arch are you using?

x64

Last Known Working Electron version

17.4.10

Expected Behavior

To enable the desktop system to match a window to the respective application, wmclass should be set on properly on wayland, as it does on X11.

grafik

Actual Behavior

The wmclass is empty on wayland, which results in the compositor not being able to recognize, which application a window belongs to:

grafik

Testcase Gist URL

No response

Additional Information

on electron 17.4.10 wmclass is set correctly

@harmathy
Copy link
Author

This might be related to [Bug]: Electron icon shown instead of app's on Wayland #34801

@vially
Copy link
Contributor

vially commented Jul 15, 2022

This seems to be a duplicate of #33578 which should have been fixed by #34855 but it didn't make it into a stable release yet (although it was back-ported to versions 18, 19 and 20).

@RaisinTen
Copy link
Member

@vially this issue seems to be about the wmclass property, not the app_id property which your PR fixed, right?

@vially
Copy link
Contributor

vially commented Jul 18, 2022

this issue seems to be about the wmclass property, not the app_id property which your PR fixed, right?

This is a bit confusing because WM_CLASS is an X11 concept which does not exist in Wayland. The equivalent of WM_CLASS in Wayland is the app_id property (this page has some more information).

But this issue mentions "WM_CLASS is not set on wayland", which could mean two things:

  • the WM_CLASS property is not set when the app is run through XWayland
    e.g.: by running Electron without the --ozone-platform=wayland flag
  • the app_id property (which is the Wayland equivalent of WM_CLASS) is not set when the app is running natively on Wayland
    e.g.: by using the --ozone-platform=wayland flag

My previous comment assumed it was the latter, but maybe @harmathy can clarify this a bit.

@harmathy
Copy link
Author

harmathy commented Jul 18, 2022

In Looking Glass all windows have a wmclass property and in the Desktop Entry Specification there is a StartupWMClass, which has to be set correctly on wayland as well as on X11.

Running on Xwayland an electron window looks like this:

grafik

on pure wayland:

grafik

I guess, app_id is just mapped to WM_CLASS in GNOME on wayland for backwards-compatibility, but I can't be sure (until #34855 is in a release).

@vially
Copy link
Contributor

vially commented Jul 18, 2022

Thanks, that makes sense.

I still think this is a duplicate of #33578 so it's worth testing if the issue is still present in the nightly version of Electron (npm install electron-nightly).

If this is fixed in nightly, then it was most likely fixed by #34855 which was backported to versions 18, 19 and 20 so it should be part of their next minor/patch release.

@ckerr ckerr added the blocked/need-info ❌ Cannot proceed without more information label Jul 18, 2022
@ckerr
Copy link
Member

ckerr commented Jul 18, 2022

I agree with @vially that this sounds like #33578; but I'm not positive, so I'll leave this open as blocked/needs-info instead of closing. @harmathy please do try a nightly as Valentin suggested and see if it WfY. Thanks!

@harmathy
Copy link
Author

harmathy commented Aug 4, 2022

I can confirm, this issue is fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants