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

[Feature Request]: environment variable to enable wayland support and get rid of individual --enable-features=UseOzonePlatform --ozone-platform=wayland flags #30897

Closed
3 tasks done
pshirshov opened this issue Sep 9, 2021 · 9 comments · Fixed by #39792 · May be fixed by #35630

Comments

@pshirshov
Copy link

pshirshov commented Sep 9, 2021

Preflight Checklist

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

@vchernin
Copy link

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
Copy link

felikcat commented Nov 2, 2021

With this, a global flatpak override to 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.software

@B1773rm4n
Copy link

What is the status here?

@DeedleFake
Copy link

With this, a global flatpak override to make all Flatpak'd Electron software use Wayland by default would be possible.

And a global override to activate the experimental client-side decorations, too, which is quite useful on GNOME, despite the bugs (#33161).

@qguv
Copy link

qguv commented 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 .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

  1. 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
Copy link

Related: recently merged #34937 added flag --ozone-platform-hint=auto , which at least allows moving back and forth between wayland and X11.

@pshirshov
Copy link
Author

Still bad and not what we all need.

@gianni-rosato
Copy link

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

This comment was marked as abuse.

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