You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: environment variable to enable wayland support and get rid of individual --enable-features=UseOzonePlatform --ozone-platform=wayland flags #30897
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
Currently Wayland support in Electron needs to be turned on on per-app basis with --enable-features=UseOzonePlatform --ozone-platform=wayland flags.
This is very inconvenient: we have to repeat this chore for every single Electron app, we need to take care of CLI aliases, etc, etc.
Without these flags Electron apps look blurry and are almost unusable when fractional scaling is on.
Proposed Solution
Electron should read these options from an environment variable, like ELECTRON_OPTS, this way the user would be able to turn on Wayland support globally.
Alternatives Considered
Alternatively Electron may support environment variables like
ELECTRON_OZONE_PLATFORM ELECTRON_ENABLE_FEATURES
Additional Information
No response
Reacted by Odomontois, Parabellum1905y, Shaw Vrana, İlkecan Bozdoğan, Tim DeHerrera, Eric Drechsel, Tristan Partin, Valentin Hăloiu, Else, Someone, Gleb Buzin and 75 more
For what it's worth this is progressing slowly but surely upstream. Ozone/X11 is on by default in Chromium, so hopefully the work to enable Ozone/Wayland will keep progessing, so it's enabled by default in Electron.
But yes an environment variable would be handy in the meantime.
Reacted by parcelcat, starget24, Bas van den Wollenberg, wallabra, Gianni Rosato and Suraj
To run under Wayland, most electron applications need special flags to be passed at launch.1 This is a big headache for Linux distribution package maintainers and full-time Wayland users. Many apps (e.g. VS Code) don't respect $XDG_CONFIG_HOME/electron-flags.conf—for these applications, an environment variable may provide a decent, global alternative to manually patching .desktop entries and throwing wrapper scripts in /usr/local/bin whose sole purpose is to pass --enable-features=UseOzonePlatform --ozone-platform=wayland.
Here's a short description of the hoops users often have to jump through, from the Arch Wiki article on Wayland.
Allowing these to be configured with an environment variable would go a long way toward making it easier to configure electron applications to behave property under Wayland.
Of course, the ideal situation would be for Electron to enable proper Wayland support by default, but as long as users are going to have to manually ask electron apps to run under Wayland, I think it's worth making this a global setting.
For these reasons, it would be very nice to see support for environment-based configuration of OzonePlatform!
Footnotes
These applications will run in XWayland if the flags are not passed, which looks awful on high-dpi screens, or when scaling is enabled, or when accessibility tools are used. There are also limitations for things like screen sharing, multiple displays, desktop notifications and alerts, window compositing, etc. ↩
Reacted by wallabra, Gadi Cohen, Varac, Jeremy McCoy, Toshimega, Bacteria, Vadim Sysoev, queeup, James Edwards-Jones, puz_zle and 10 more
I'm going to second that this is a huge issue. I use a display with fractional scaling, so Wayland is a necessity & it'd be nice for apps to "just work" instead of jumping through these hoops. X11 is dying, Wayland is gaining market share, something should be done.
Reacted by dryya, maymage, Ztereo, Esat Mustafa Namlı, Adam, Tomáš Král, Julian, Carl, Cade, Areiser and 7 more
Activity
vchernin commentedon Sep 24, 2021
For what it's worth this is progressing slowly but surely upstream. Ozone/X11 is on by default in Chromium, so hopefully the work to enable Ozone/Wayland will keep progessing, so it's enabled by default in Electron.
But yes an environment variable would be handy in the meantime.
felikcat commentedon Nov 2, 2021
With this, a global
flatpak overrideto make all Flatpak'd Electron software use Wayland by default would be possible.If it breaks,
flatpak override --unset-env=ELECTRON_OZONE_PLATFORM --unset-env=ELECTRON_ENABLE_FEATURES name.of.softwareB1773rm4n commentedon Mar 31, 2022
What is the status here?
DeedleFake commentedon Mar 31, 2022
And a global override to activate the experimental client-side decorations, too, which is quite useful on GNOME, despite the bugs (#33161).
qguv commentedon Jun 14, 2022
To run under Wayland, most electron applications need special flags to be passed at launch.1 This is a big headache for Linux distribution package maintainers and full-time Wayland users. Many apps (e.g. VS Code) don't respect
$XDG_CONFIG_HOME/electron-flags.conf—for these applications, an environment variable may provide a decent, global alternative to manually patching.desktopentries and throwing wrapper scripts in/usr/local/binwhose sole purpose is to pass--enable-features=UseOzonePlatform --ozone-platform=wayland.Here's a short description of the hoops users often have to jump through, from the Arch Wiki article on Wayland.
Allowing these to be configured with an environment variable would go a long way toward making it easier to configure electron applications to behave property under Wayland.
Of course, the ideal situation would be for Electron to enable proper Wayland support by default, but as long as users are going to have to manually ask electron apps to run under Wayland, I think it's worth making this a global setting.
For these reasons, it would be very nice to see support for environment-based configuration of OzonePlatform!
Footnotes
These applications will run in XWayland if the flags are not passed, which looks awful on high-dpi screens, or when scaling is enabled, or when accessibility tools are used. There are also limitations for things like screen sharing, multiple displays, desktop notifications and alerts, window compositing, etc. ↩
eddy-geek commentedon Sep 7, 2022
Related: recently merged #34937 added flag
--ozone-platform-hint=auto, which at least allows moving back and forth between wayland and X11.pshirshov commentedon Sep 7, 2022
Still bad and not what we all need.
gianni-rosato commentedon Feb 16, 2023
I'm going to second that this is a huge issue. I use a display with fractional scaling, so Wayland is a necessity & it'd be nice for apps to "just work" instead of jumping through these hoops. X11 is dying, Wayland is gaining market share, something should be done.
pshirshov commentedon Feb 16, 2023