Description
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
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
bevy/crates/bevy_winit/src/winit_windows.rs
Lines 62 to 72 in e9418b3
I understand why MonitorSelection::Current won't work(hardcoded as None), but I don't know why MonitorSelection::Primary won't work either.