Skip to content

Electron 38 and above do not use Wayland by default #48298

Closed

Description

@alexsch01

Preflight Checklist

Electron Version

38.0.0, 38.1.0, 39-alpha, 40-nightly

What operating system(s) are you using?

Other Linux

Operating System Version

Linux penguin 6.6.88-08507-gc5e3cc23fa55 #1 SMP PREEMPT_DYNAMIC Fri, 1 Aug 2025 01:52:13 -0700 x86_64 GNU/Linux

What arch are you using?

x64

Last Known Working Electron version

never

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

XDG_SESSION_TYPE=wayland npx electron should open in Wayland mode by default

Actual Behavior

XDG_SESSION_TYPE=wayland npx electron doesn't open in Wayland mode by default

If I disable Xwayland, electron will not open

Testcase Gist URL

No response

Additional Information

The docs say

You should use the XDG_SESSION_TYPE=wayland environment variable instead to use Wayland.

but this is not true

Activity

  1. added theissue type on Sep 11, 2025
  2. moved this to 👀 Unsorted Items in 38-x-yon Sep 11, 2025
  3. moved this to 👀 Unsorted Items in 39-x-yon Sep 11, 2025
  4. changed the title [-]Electron 38.1.0 doesn't use Wayland by default[/-] [+]Electron 38 and above doesn't use Wayland by default[/+] on Sep 11, 2025
  5. changed the title [-]Electron 38 and above doesn't use Wayland by default[/-] [+]Electron 38 and above do not use Wayland by default[/+] on Sep 11, 2025
  6. nikwen commented on Sep 11, 2025

    @nikwen
    Member

    Thanks for reporting!

    Here's an explanation of why the change was made: #48001

    That said, that issue also has a comment mentioning that this no longer works properly.

    CC @clavin

  7. added
    has-repro-comment
    on Sep 11, 2025
  8. clavin commented on Sep 11, 2025

    @clavin
    Member

    Oops, this is totally right! I missed a call to the function that connects this env var to Chromium.

    My apologies to Wayland users, I'll push a fix shortly. 🙇

  9. added
    status/confirmed
    on Sep 11, 2025
  10. alexsch01 commented on Sep 12, 2025

    @alexsch01
    ContributorAuthor

    I also notice with electron@38 and above currently, passing --ozone-platform=wayland will attempt to open Wayland mode but never shows the electron window

    @clavin sorry to ping you, but does your PR fix that?

  11. nikwen commented on Sep 14, 2025

    @nikwen
    Member

    @alexsch01 Can you test with the nightly that we'll release on Monday? If you still see that issue, could you please open a new issue for it? Thank you!

  12. JGCarroll commented on Sep 15, 2025

    @JGCarroll

    I've updated the joplin-desktop snap with today's nightly.

    sudo snap install joplin-desktop --edge

    I'm trying it in a Virtual Machine and suddenly I've got a wonderful problem, to have the "Wayland" icon! YAY! Unfortunately it doesn't work. It does in X11 though.

    Could people try this on real hardware maybe and confirm if there's an issue? I'm testing in Fedora KDE in Hyper V, which isn't ideal perhaps.

    jcarroll@fedora:~$ unset XDG_SESSION_TYPE
    jcarroll@fedora:~$ joplin-desktop
    Error org.freedesktop.DBus.Error.Failed: cannot set "default-url-scheme-handler" subproperty "joplin" setting to invalid value "@joplin/app-desktop.desktop"
    Sentry: Initialized with autoUploadCrashDumps: false
    
    (joplin:3701): Gtk-WARNING **: 23:49:05.504: Theme parsing error: gtk.css:1:21: Failed to import: Error opening file /home/jcarroll/snap/joplin-desktop/125/.config/gtk-3.0/colors.css: No such file or directory
    Gtk-Message: 23:49:05.529: Failed to load module "colorreload-gtk-module"
    Gtk-Message: 23:49:05.529: Failed to load module "window-decorations-gtk-module"
    [3868:0915/234905.817297:ERROR:components/viz/service/main/viz_main_impl.cc:189] Exiting GPU process due to errors during initialization
    (node:3907) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `exe --trace-deprecation ...` to show where the warning was created)
    
    # Looks bad? This is working fine, XWayland is in use and the app works fine.
    
    jcarroll@fedora:~$ XDG_SESSION_TYPE=wayland joplin-desktop
    [4050:0915/234920.294742:ERROR:ui/ozone/platform/wayland/common/drm_render_node_path_finder.cc:45] drmGetDevices2() has not found any devices: Operation not permitted (1)
    Error org.freedesktop.DBus.Error.Failed: cannot set "default-url-scheme-handler" subproperty "joplin" setting to invalid value "@joplin/app-desktop.desktop"
    Sentry: Initialized with autoUploadCrashDumps: false
    [4050:0915/234920.779590:ERROR:ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc:305] drmGetDeviceFromDevId() returned an error: Resource temporarily unavailable (11)
    
    (joplin:4050): Gtk-WARNING **: 23:49:20.888: Theme parsing error: gtk.css:1:21: Failed to import: Error opening file /home/jcarroll/snap/joplin-desktop/125/.config/gtk-3.0/colors.css: No such file or directory
    [4161:0915/234920.919391:ERROR:ui/ozone/platform/wayland/common/drm_render_node_path_finder.cc:45] drmGetDevices2() has not found any devices: Invalid argument (22)
    [4161:0915/234920.956561:ERROR:components/viz/service/main/viz_main_impl.cc:189] Exiting GPU process due to errors during initialization
    [4233:0915/234920.981454:ERROR:ui/ozone/platform/wayland/common/drm_render_node_path_finder.cc:45] drmGetDevices2() has not found any devices: Interrupted system call (4)
    [4233:0915/234921.016411:ERROR:components/viz/service/main/viz_main_impl.cc:189] Exiting GPU process due to errors during initialization
    [4278:0915/234921.025026:ERROR:ui/ozone/platform/wayland/common/drm_render_node_path_finder.cc:45] drmGetDevices2() has not found any devices: Interrupted system call (4)
    (node:4272) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `exe --trace-deprecation ...` to show where the warning was created)
    
    # Wayland icon shown in desktop (likely packaging error with `StartupWMClass` - but regardless, app is completely dead.
    
    ^Cjcarroll@fedora:~$ 

    Edit:
    Very likely a VM problem, works with --disable-GPU

    Image
  13. alexsch01 commented on Sep 15, 2025

    @alexsch01
    ContributorAuthor

    @JGCarroll I reported an issue to Electron
    #48321

  14. JGCarroll commented on Sep 15, 2025

    @JGCarroll

    Thanks for reporting that separately :)

    FWIW for future packagers who see Wayland icons like the above, the taskbar icons are related to StartupWMClass in .desktop files as mentioned, adjusting my work now, I get this.

    Image

    The window bar itself might be a valid Electron issue, but I think as far as high level flag controlling this goes, it seems to be working great and everything else is separate specific issues (or downstream packaging)

  15. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 39-x-yon Sep 17, 2025
  16. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 38-x-yon Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    38-x-y39-x-ybug 🪲has-repro-commentplatform/linuxstatus/confirmedwayland

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions