Skip to content

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

Closed

Description

@pshirshov

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

Activity

  1. vchernin commented on Sep 24, 2021

    @vchernin

    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.

  2. felikcat commented on Nov 2, 2021

    @felikcat

    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

  3. B1773rm4n commented on Mar 31, 2022

    @B1773rm4n

    What is the status here?

  4. DeedleFake commented on Mar 31, 2022

    @DeedleFake

    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).

  5. qguv commented on Jun 14, 2022

    @qguv

    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. ↩

  6. eddy-geek commented on Sep 7, 2022

    @eddy-geek

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

  7. pshirshov commented on Sep 7, 2022

    @pshirshov
    Author

    Still bad and not what we all need.

  8. gianni-rosato commented on Feb 16, 2023

    @gianni-rosato

    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.

  9. pshirshov commented on Feb 16, 2023

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions