electron: Native Wayland is completely BROKEN in Electron
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
32.2.1
What operating system(s) are you using?
Ubuntu
Operating System Version
Ubuntu 24.04.1
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
The flags --enable-features=UseOzonePlatform --ozone-platform=wayland or --ozone-platform-hint=wayland --enable-features=WaylandWindowDecorations should open the Electron application in a native wayland window without any issues.
Actual Behavior
The application does not open at all, it will only open in XWayland only. Forcing Native Wayland with any flags such as --enable-features=UseOzonePlatform --ozone-platform=wayland or --ozone-platform-hint=wayland --enable-features=WaylandWindowDecorations will prevent the application from opening.
Testcase Gist URL
No response
Additional Information
Native Wayland is simply not supported in Electron, this has been tested on GNOME Shell 46, if the results are different on other wayland compositor shells or operating systems, please list them below. To test it out, please use the --enable-features=UseOzonePlatform --ozone-platform=wayland or --ozone-platform-hint=wayland --enable-features=WaylandWindowDecorations flags.
This is also why other Electron applications such as VS Code have these issues: https://github.com/microsoft/vscode/issues/207033 https://github.com/microsoft/vscode/issues/231955
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (3 by maintainers)
I’m on a similar hardware config as yours, but cannot get it to work.
are these files in the correct place?
The env var seems to be correctly set:
Just to add some info. Running vscode/chrome without any flag for ozone is impossible here because it freezes a lot, I’m running Ubuntu 24.04.1 LTS with Wayland (because I need the fractional scaling feature). To solve my freezing problems with vscode I created the
code-flags.confandelectron-flags.confwithAnd added the
export ELECTRON_OZONE_PLATFORM_HINT=autoto my.zshrcSame for chrome, switching between profiles, tabs, freezes and crashes a lot, had to define
chrome://flags/#ozone-platform-hinttoauto.My machine has 32GB of RAM, Nvidia RTX4060, I9 13gen, so it’s for sure not a lack of resources, something is not right between Electron Apps and Wayland, lot’s of issues on reddit/github about it.
When running the
killall -vws2 Xwaylandit killed vscode but not chrome.For me looks like
ozone-platform-hint=autoshould be the default behavior on electron apps.