Skip to content

Enable wayland by default #4106

Closed

Description

@kobutri

What problem does this solve or what need does it fill?

Without enabling wayland bevy fails on systems that support wayland instead of falling back to x11, supported by xwayland.
This is because wgpu won't support x11 windows, when wayland is available on the system.

What solution would you like?

simply add "wayland" to the default features list.

What alternative(s) have you considered?

You can of course enable it manually, but many will forget and simply assume that wayland will be supported via xwayland.

Activity

  1. added
    C-FeatureA new feature, making something new possible
    S-Needs-TriageThis issue needs to be labelled
    on Mar 4, 2022
  2. added
    C-UsabilityA targeted quality-of-life change that makes Bevy easier to use
    O-LinuxSpecific to the Linux desktop operating system
    and removed
    C-FeatureA new feature, making something new possible
    S-Needs-TriageThis issue needs to be labelled
    on Mar 4, 2022
  3. bjorn3 commented on Mar 4, 2022

    @bjorn3
    Contributor

    It may also be nice to default to X11 (through Xwayland) on GNOME even when wayland is supported as GNOME refuses to properly implement some parts of wayland. For example they don't support server side decorations, so winit has to draw a rather ugly title bar itself instead.

  4. kobutri commented on Mar 4, 2022

    @kobutri
    Author

    That would be a bad idea, because wgpu's gles backend will always use wayland when possible.
    There is some discussion in winit and smithay_client_toolkit about adding libdecor support, for wayland, but for now we have to live with not the prettiest solution.

  5. bjorn3 commented on Mar 4, 2022

    @bjorn3
    Contributor

    That would be a bad idea, because wgpu's gles backend will always use wayland when possible.

    Then that is already a problem when wayland support is entirely disabled in winit. gfx-rs has logic to recreate the egl context when creating a surface for a different wayland window. I feel like this logic could be extended to recreating the egl context when creating a surface for an xcb or xlib window.

  6. heavyrain266 commented on Mar 4, 2022

    @heavyrain266

    GNOME will never add SSD because they asume that everyone uses GTK and prefered to implement titlebars with additional buttons, menus etc. as CSD thing...

    About libdecor, I found out it as kind of library which isn't FFI friendly at all and getting it stabilized in SCTK may take months.

  7. mockersf commented on Mar 5, 2022

    @mockersf
    Member

    What's the impact of enabling Wayland when running somewhere it's not available? Longer build times? Larger binaries?

  8. kirusfg commented on Mar 7, 2022

    @kirusfg
    Contributor

    Regarding the topic of SSD in Gtk: I have stumbled upon this issue in a Wayland compositor and there is a PR to fix this issue in Gtk by enabling optional SSD (judging from the description, that is what it does; correct me if I am wrong).

    Might be of interest to you @heavyrain266.

  9. heavyrain266 commented on Mar 7, 2022

    @heavyrain266

    Regarding the topic of SSD in Gtk: I have stumbled upon this issue in a Wayland compositor and there is a PR to fix this issue in Gtk by enabling optional SSD (judging from the description, that is what it does; correct me if I am wrong).

    Might be of interest to you @heavyrain266.

    That doesn't fix absence of SSD in Mutter itself (GNOME's compositor) but adds option that you can disable GTK CSD in your Compositor to use your own SSD implementation.

  10. mcobzarenco commented on Mar 15, 2022

    @mcobzarenco
    Contributor

    What alternative(s) have you considered?
    You can of course enable it manually, but many will forget and simply assume that wayland will be supported via xwayland.

    For GNOME in Ubuntu, that would mean having to manually disable it to continue to use x11 (as this comment notes)?

  11. kobutri commented on Mar 18, 2022

    @kobutri
    Author

    For GNOME in Ubuntu, that would mean having to manually disable it to continue to use x11 (as this comment notes)?

    XWayland is currently broken for wgpu with gles as it is will create an Instance that is only compatible with wayland if wayland is available.

  12. keis commented on Aug 7, 2022

    @keis

    Was scratching my head for a long while trying to figure out why the program was not exiting after closing the window. Enabling the wayland backend to stop relying to xwayland fixed the issue. Brief testing revealed no other issues.

  13. orowith2os commented on Jul 1, 2023

    @orowith2os

    For example they don't support server side decorations, so winit has to draw a rather ugly title bar itself instead.

    There's nothing improper about this. It's perfectly valid in the spec to not support SSDs, and in some cases, expected, even. Plus, now we have libdecor and adwaita-sctk. There's not much need for SSDs, as now we can still get a similar end result.

    In the process, this can make the creation of a compositor vastly simpler.

  14. Friz64 commented on Nov 28, 2023

    @Friz64
    Contributor

    image

    I have worked hard on adding window shadows to sctk-adwaita, so the window decorations will, once this work is released and the dependencies are updated, fit right in on the GNOME desktop.

    I can't live without wayland these days. The input-lag/latency is much lower and resizing windows is smooth as butter, compared to the stuttery mess that is X11, especially on high refresh rate screens.

  15. pkupper commented on Nov 28, 2023

    @pkupper
    Contributor

    Another reason for wayland by default would be proper fractional scaling support. On my system (scale factor 1.5) applications running via XWayland applications are blurry due to being upscaled.

  16. Friz64 commented on Nov 30, 2023

    @Friz64
    Contributor

    What's the impact of enabling Wayland when running somewhere it's not available? Longer build times? Larger binaries?

    About a 5% difference in compile time. This is 33.4s -> 35.2s on my beefy Ryzen 9 7900X machine, as shown below. Of course, on slower computers, this will be more noticeable.

    $ hyperfine --prepare 'cargo clean' 'cargo build --release --example 3d_scene' 'cargo build --release --example 3d_scene --features wayland'
    Benchmark 1: cargo build --release --example 3d_scene
      Time (mean ± σ):     33.408 s ±  0.281 s    [User: 646.068 s, System: 20.888 s]
      Range (min … max):   33.037 s … 33.850 s    10 runs
     
    Benchmark 2: cargo build --release --example 3d_scene --features wayland
      Time (mean ± σ):     35.205 s ±  0.157 s    [User: 705.365 s, System: 24.624 s]
      Range (min … max):   34.995 s … 35.429 s    10 runs
     
    Summary
      cargo build --release --example 3d_scene ran
        1.05 ± 0.01 times faster than cargo build --release --example 3d_scene --features wayland
    

    The binary size for the 3d_scene example went from 61M to 64M, which is also about a 5% increase.

  17. added a commit that references this issue on Aug 1, 2025
    ff40a6a
  18. added a commit that references this issue on Aug 9, 2025
    684c7ab
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

    C-UsabilityA targeted quality-of-life change that makes Bevy easier to useO-LinuxSpecific to the Linux desktop operating system

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions