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]: app_id not set when running Electron with native Wayland #33578

Closed
3 tasks done
chrhasse opened this issue Apr 2, 2022 · 9 comments · Fixed by #34855
Closed
3 tasks done

[Bug]: app_id not set when running Electron with native Wayland #33578

chrhasse opened this issue Apr 2, 2022 · 9 comments · Fixed by #34855
Labels

Comments

@chrhasse
Copy link

chrhasse commented Apr 2, 2022

Preflight Checklist

Electron Version

18.0.1

What operating system are you using?

Other Linux

Operating System Version

Arch Linux

What arch are you using?

x64

Last Known Working Electron version

18.0.0

Expected Behavior

The app_id window property should be set to the same value as class under X11.

Actual Behavior

app_id is an empty string when running Electron under Wayland.

Testcase Gist URL

No response

Additional Information

While most apps would crash prior to #33355, the default page if you run electron --ozone-platform=wayland would still run and properly set app_id.

@zcbenz zcbenz added bug/regression ↩️ A new version of Electron broke something platform/linux labels Apr 6, 2022
@zcbenz
Copy link
Member

zcbenz commented Apr 6, 2022

/cc @p2004a

@p2004a
Copy link
Contributor

p2004a commented Apr 7, 2022

I will try to reproduce and bisect the issue in the next couple of days.

@p2004a
Copy link
Contributor

p2004a commented Apr 8, 2022

@chrhasse I have problem with reproducing this.

Using test app from https://www.electronjs.org/docs/latest/tutorial/quick-start

When I run electron version 18.0.0 under X11 I see that the WM_CLASS is set as application name my-electron-app. When I run on wayland I get:

$ WAYLAND_DEBUG=1 ELECTRON_ENABLE_LOGGING=true ~/Downloads/electron-v18.0.0-linux-x64/electron --ozone-platform=wayland test_app |& grep 'app_id'
[2507759.298]  -> xdg_toplevel@46.set_app_id("")

So the app_id is not set under wayland already under version 18.0.0 (I've not tested anything earlier then that).

@chrhasse
Copy link
Author

chrhasse commented Apr 9, 2022

Sorry, I think I must have made a mistake in my testing. I can't easily test older builds from this repository as they crash due to #32436 (for my system on Arch Linux with Sway 1.7), so I've been testing using my distro's packages. I had built 18.0.0 by modifying the PKGBUILD for 17.2.0, but I deleted the PKGBUILD and the package after my initial testing, and when I rebuilt it using a modified 18.0.1 PKGBUILD for convenience's sake, it wasn't setting the app_id. I'm not sure if I tested the wrong version initially or if it has to do with the package maintainer's patches (which can be found here). I can rebuild with a modified 17.2.0 PKGBUILD if I needed, but compilation takes me 2 and a half hours so I'd rather avoid it.

At any rate, if I downgrade to 17.2.0 from the Arch repositories and run:

$ WAYLAND_DEBUG=1 ELECTRON_ENABLE_LOGGING=true electron --ozone-platform=wayland |& grep 'app_id' 
[2615031.990]  -> xdg_toplevel@45.set_app_id("Electron")

The only version I can test from the GitHub releases is 13.6.9 which also properly sets app_id:

$ WAYLAND_DEBUG=1 ELECTRON_ENABLE_LOGGING=true ./electron --enable-features=UseOzonePlatform --ozone-platform=wayland |& grep 'app_id'
[2926405.757]  -> xdg_toplevel@35.set_app_id("Electron")

@p2004a
Copy link
Contributor

p2004a commented Apr 10, 2022

Thanks, so the regression isn't between 18.0.0 and 18.0.1 but between 17 and 18 branches and is not related to my fixes.

I did git bisect on the main branch and 28ada6e is the first commit where app_id is not set, introducing this regression.

@enx1998
Copy link

enx1998 commented May 25, 2022

Hi @p2004a, first of all thanks for your work.
Do you have any update on this issue? I start having applications without the name:
image
The one in the screenshot is Mattermost 5.1.0 which use Electron to v18.0.3.

Thanks ENx

@p2004a
Copy link
Contributor

p2004a commented May 25, 2022

@enx1998 I'm not currently actively working on it, I've only verified that this is not caused by my changes.

@aslpavel
Copy link

aslpavel commented Jul 9, 2022

New VSCode now has empty app_id as well, since it has switched to electron 18 :(

@andynd
Copy link

andynd commented Jul 9, 2022

It would be even better to have a way to overwrite the app_id via the environment or a CLI option.
app_id is the only real way to differentiate windows under wayland if you are using a tiling window manager and want to pin some applications to some workspaces.
I've run into this problem with all sorts of electron apps and would realy love to have a single upstream fix which idealy results in a single option to set this value on all electron apps vs opening bugs at all the downstream projects using electron and getting 10 different solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Doesn't Block Stable
Development

Successfully merging a pull request may close this issue.

7 participants