bevyengine / bevyengine/bevy

Failed to start as fullscreen on wayland

Open
#19,215 3 comments 0 reactions 0 assignees View on GitHub
A-Windowing C-Bug O-Linux S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

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 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:

```Rust
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 https://github.com/bevyengine/bevy/blob/e9418b3845c1ffc9624a3a4003bde66a2ad6566a/crates/bevy_winit/src/winit_windows.rs#L62-L72

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

Contributor guide

Open the contributing guide

Research direction

Start with the MonitorSelection handling in crates/bevy_winit/src/winit_windows.rs around the linked lines, then reproduce the minimal fullscreen app on a pure Wayland setup. Compare Primary, Current, and Index(0) behavior and trace why monitor lookup fails. Done means the app no longer panics when starting fullscreen on Wayland and the supported selection behaves consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.