Skip to content

[Feature Request]: Please support Wayland by default in Electron on Linux #41551

Description

@GerryT11

Preflight Checklist

Electron Version

26.2.4

What operating system are you using?

Ubuntu

Operating System Version

6.2.0-39-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:18:00 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

As of today, Electron applications do not support/enable Wayland out of the box, but rather run under XWayland. Please support Wayland by default in Electron on Linux. Are there any blocker issues to enable Wayland by default?

For example, I had a discussion with RStudio developers who decided to wait enabling Wayland by default until Wayland is supported by default out-of-the-box in Electron. rstudio/rstudio#11962 (comment)

Actual Behavior

.

Testcase Gist URL

No response

Additional Information

No response

Activity

  1. ryanabx commented on Mar 13, 2024

    @ryanabx

    I agree -- I feel like it's well past time for ozone-platform to be auto on electron. I don't know necessarily what the hold up is upstream (chromium), though if someone knows please let me know, I've been trying to figure it out for a while now.

  2. changed the title [-][Bug]: Please support Wayland by default in Electron on Linux[/-] [+][Feature Request]: Please support Wayland by default in Electron on Linux[/+] on Mar 19, 2024
  3. vially commented on Mar 23, 2024

    @vially
    Contributor

    #35630 would address this, but it was argued that Electron shouldn't deviate from Chromium on this.

  4. ryanabx commented on Mar 24, 2024

    @ryanabx

    Yeah, it'd of course be nice to follow upstream on this, but I still am left wondering when chromium will support Wayland/auto by default?

    Chromium ought to have a roadmap or an issue tracker for Wayland enablement.

  5. veodko commented on Jul 17, 2024

    @veodko

    What was a problem on my side anyway was the fact that electron prebuilt binary is linked to a ton of X11 libraries that are not available when operating on a wayland only distribution obviously (custom yocto/buildroot builds). No matter what I set in ELECTRON_OZONE_PLATFORM_HINT, I couldn't run my electron app on wayland because of missing libraries like libXrandr.so or libX11.so. Even though they are probably not used on wayland, they are still linked to the binary and required.

    How do you go around this? I just copied a bunch of libs and passed them using LD_LIBRARY_PATH which finally made it work, but it's a cumbersome solution. X11 should die a long time ago.

  6. banekondic1996 commented on Jul 23, 2024

    @banekondic1996
  7. v3ss0n commented on Sep 10, 2024

    @v3ss0n

    What was a problem on my side anyway was the fact that electron prebuilt binary is linked to a ton of X11 libraries that are not available when operating on a wayland only distribution obviously (custom yocto/buildroot builds). No matter what I set in ELECTRON_OZONE_PLATFORM_HINT, I couldn't run my electron app on wayland because of missing libraries like libXrandr.so or libX11.so. Even though they are probably not used on wayland, they are still linked to the binary and required.

    How do you go around this? I just copied a bunch of libs and passed them using LD_LIBRARY_PATH which finally made it work, but it's a cumbersome solution. X11 should die a long time ago.

    X11 won't die - Wayland would die first and replace by something else . Wayland DEVs's made so many decisions that screws wayland.

    Here are problems of wayland and many of them wont be fixed , because it against the wayland core develoeprs's belief and ideologies just like religious fanatics.

    https://gist.github.com/probonopd/9feb7c20257af5dd915e3a9f2d1f2277

    Don't get me wrong. There are many problems at X11 , which could be solved if there is a new X11 that might deviate from X11 protocol but backward compatible - instead of a rewrite filled with bad decision that breaks so many things - by design.

  8. ryanabx commented on Sep 10, 2024

    @ryanabx

    We're getting pretty far off topic with that previous comment. The reality is that linux is moving in the direction of wayland, because it's what most developers are supporting nowadays. Make something worthwhile, and linux will move that way. There's no conspiracy, nothing is being forced onto people, just open source being open source

  9. fxzxmicah commented on Oct 23, 2024

    @fxzxmicah

    What was a problem on my side anyway was the fact that electron prebuilt binary is linked to a ton of X11 libraries that are not available when operating on a wayland only distribution obviously (custom yocto/buildroot builds). No matter what I set in ELECTRON_OZONE_PLATFORM_HINT, I couldn't run my electron app on wayland because of missing libraries like libXrandr.so or libX11.so. Even though they are probably not used on wayland, they are still linked to the binary and required.
    How do you go around this? I just copied a bunch of libs and passed them using LD_LIBRARY_PATH which finally made it work, but it's a cumbersome solution. X11 should die a long time ago.

    X11 won't die - Wayland would die first and replace by something else . Wayland DEVs's made so many decisions that screws wayland.

    Here are problems of wayland and many of them wont be fixed , because it against the wayland core develoeprs's belief and ideologies just like religious fanatics.

    https://gist.github.com/probonopd/9feb7c20257af5dd915e3a9f2d1f2277

    Don't get me wrong. There are many problems at X11 , which could be solved if there is a new X11 that might deviate from X11 protocol but backward compatible - instead of a rewrite filled with bad decision that breaks so many things - by design.

    But your fantasy didn't come true. In addition, the default support for wayland does not mean that x11 is removed.

  10. fxzxmicah commented on Oct 23, 2024

    @fxzxmicah

    use_ozone=true ozone_auto_platforms=false ozone_platform="wayland" ozone_platform_wayland=true
    Build with these parameters to get a wayland-based chromium.

  11. fxzxmicah commented on Oct 23, 2024

    @fxzxmicah

    #35630 would address this, but it was argued that Electron shouldn't deviate from Chromium on this.

    In theory, we should follow upstream, but in practice, chromium is just one software, and its unsupported state can be changed with a single command line argument. Electron represents a myriad of software, which requires the user to set myriad command-line arguments. In this case, the benefits of following upstream are limited.

  12. willmtemple commented on Dec 8, 2024

    @willmtemple

    I just wanted to add some evidence to this issue of why this would be useful. It's not just an implementation detail, it negatively impacts how Electron apps render on some Linux desktop environments. In particular, on GNOME when using UI scaling, especially fractional scaling, it causes text to look blurry. Here's a side by side image of Discord loaded in Thorium using --ozone-platform=wayland (left) and Discord packaged in an Electron app (right):

    Image

    You can see that the text on the left (Thorium) is crisp, but on the right (Electron) the whole application is blurry and this really stands out on text. This affects every electron app on my system and it's been that way for years.

    Running Discord via flatpak run --socket=wayland com.discordapp.Discord --enable-features=UseOzonePlatform --ozone-platform=wayland fixes the text issue. However, it introduces other issues of its own: no tray icon and some weird rendering artifacts in the splash screens.

  13. 3 remaining items

  14. Thatoo commented on Jul 20, 2025

    @Thatoo

    @eszlari could you explain what does that mean? Does that mean this option has been merged into chromium now and next release of electron based on this new version of chromium will solve our issues?

  15. eszlari commented on Jul 20, 2025

    @eszlari

    Upstream Chromium wants to enable Wayland by default in the development builds as an experiment, but it will take some time until this reaches the stable channel, see: https://chromiumdash.appspot.com/schedule

  16. VictorVow commented on Sep 4, 2025

    @VictorVow
  17. ryanabx commented on Sep 4, 2025

    @ryanabx

    We are using Chromium 141 in electron main branch now. Anybody who uses electron -- can we test to see if electron apps using chromium 141 have wayland on by default?

    Edit: I ran 39.0.0-alpha.1 which should have chromium 141, and it's still defaulting to X11:

    Image

    I think we're going to have to change something in electron to pick up this behavior so that we don't have to use --ozone-platform=wayland

  18. ryanabx commented on Sep 6, 2025

    @ryanabx

    Chromium 141 and up will use Wayland by default it looks like.

    Actually, it does look like Chromium 140 is wayland by default too!

  19. diegorondini commented on Oct 7, 2025

    @diegorondini

    https://chromium-review.googlesource.com/c/chromium/src/+/6771245

    Enable OverrideDefaultOzonePlatformHintToAuto feature
    
    This is required for cl/784605417 which fully launches the experiment.
    
    Change-Id: [If722ab1b2a8f6b1004b4baf22834f8f026e8eb5c](https://chromium-review.googlesource.com/q/If722ab1b2a8f6b1004b4baf22834f8f026e8eb5c)
    Bug: [40083534](https://issues.chromium.org/issues/40083534)
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6771245
    Commit-Queue: Thomas Anderson <[email protected]>
    Reviewed-by: Kramer Ge <[email protected]>
    Reviewed-by: Nico Weber <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1489138}
    

    This was actually immediately reverted (as can be seen in the last gerrit change log):
    https://chromium-review.googlesource.com/c/chromium/src/+/6772226

    The change actually went in August 4, 2025, which is included in Chromium 141.0.7340.0+:
    chromium/chromium@8f2c7d1

  20. pounard commented on Oct 7, 2025

    @pounard

    Since electron 38 upgrade (element-desktop, signal) it doesn't honnor system-wide configuration using environment variables anymore, and doesn't seem to accept any command line option anymore either. Fractional scaling is broken, is there anything I missed?

  21. mitchchn commented on Nov 28, 2025

    @mitchchn
    Member

    Electron runs in Wayland by default as of Electron 38.2 and newer. You can opt out with a command line flag but there is no longer an environment variable:
    https://www.electronjs.org/blog/electron-38-0#removed-electron_ozone_platform_hint-environment-variable

  22. pounard commented on Dec 2, 2025

    @pounard

    Sad news, the environment variable was a convenient way to set the setting system-wide without having to edit or create new .desktop file for each app using it.

  23. nikwen commented on Dec 12, 2025

    @nikwen
    Member

    Closing this as per @mitchchn's comment.

  24. pounard commented on Dec 12, 2025

    @pounard

    I don't want to be rude, at anytime, because Electron is quite a complex and good product, but it seems that this time, you were maybe too eager to get rid of deprecated behaviors such as environment variables configuration, and yet the feature end up really working only 2 point releases after that, in the meantime, a lot of products using yours were broken. Some will not upgrade before again yet a few month. You moved too quickly, and it broke a lot of apps. Please, be more careful with users the next time.

    Edit: don't take it wrong, I do really appreciate electron when it brings new features such as wayland support per defaut, it's really a good thing for all hidpi screens owner, thanks.

  25. debuxxed commented on Dec 13, 2025

    @debuxxed

    doesn't work for me, as an app (Vesktop) that uses Electron 39, still runs under xwayland (Niri compositor)

  26. nikwen commented on Dec 17, 2025

    @nikwen
    Member

    You moved too quickly, and it broke a lot of apps.

    Sorry for that! We try to be careful and never break behavior on purpose.

    an app (Vesktop) that uses Electron 39, still runs under xwayland

    The app itself can choose to run under XWayland if it wants to. There are some features that are not supported by Wayland that are supported by X11, so some apps might make that choice.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions