Skip to content

Failed to start as fullscreen on wayland #19215

Open
@dearfl

Description

@dearfl

Bevy version

0.16.0

[Optional] Relevant system information

NixOS pure wayland setup.

SystemInfo { os: "Linux (NixOS 25.05)", kernel: "6.12.24", cpu: "Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz", core_count: "6", memory: "15.3 GiB" }
AdapterInfo { name: "Intel(R) UHD Graphics (CML GT2)", vendor: 32902, device: 39882, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 25.0.4", backend: Vulkan }

What you did

https://github.com/dearfl/bevy-tests/blob/7dcd8247bef8dd0773f9b57fb42c213d0eb6dc0f/src/bin/fullscreen-test.rs

ran with cargo r -r --bin fullscreen-test

What went wrong

the program panicked with the following output:

2025-05-15T18:05:45.838238Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux (NixOS 25.05)", kernel: "6.12.26", cpu: "Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz", core_count: "6", memory: "15.3 GiB" }
2025-05-15T18:05:45.870514Z  INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) UHD Graphics (CML GT2)", vendor: 32902, device: 39882, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 25.0.5", backend: Vulkan }
2025-05-15T18:05:45.946478Z  INFO gilrs_core::platform::platform::gamepad: Gamepad /dev/input/event17 (IFKB IFKB 2.4G REC (STM) System Control) connected.
2025-05-15T18:05:45.959831Z  INFO bevy_render::batching::gpu_preprocessing: GPU preprocessing is fully supported on this device.
2025-05-15T18:05:45.983393Z  INFO bevy_winit::system: Creating new window App (0v1)

thread 'main' panicked at /home/flr/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_winit-0.16.0/src/winit_windows.rs:79:22:
Unable to get monitor.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Additional information

The program is simple empty app as follow:

App::new()
        .add_plugins(DefaultPlugins.set(WindowPlugin {
            primary_window: Some(Window {
                mode: WindowMode::Fullscreen(
                    // this won't work, panics
                    MonitorSelection::Primary,
                    // this won't work either, panics
                    // MonitorSelection::Current,
                    // this works, though fullscreen is ignored on wayland
                    // MonitorSelection::Index(0),

                    VideoModeSelection::Current,
                ),
                ..Default::default()
            }),
            ..Default::default()
        }))
        .run();

checking related code at

let maybe_selected_monitor = &match window.mode {
WindowMode::BorderlessFullscreen(monitor_selection)
| WindowMode::Fullscreen(monitor_selection, _) => select_monitor(
monitors,
event_loop.primary_monitor(),
None,
&monitor_selection,
),
WindowMode::Windowed => None,
};

I understand why MonitorSelection::Current won't work(hardcoded as None), but I don't know why MonitorSelection::Primary won't work either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-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