rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.77k stars 891 forks source link

Fullscreen fails to obey requested monitor when starting up window #1270

Open goddessfreya opened 4 years ago

goddessfreya commented 4 years ago

When using the full screen example, the window will always show up on the first screen, despite what one might have requested. This was tested with i3.

Steps to reproduce, where the window will still show up on the screen HDMI-A-0 (my left screen):

    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/examples/fullscreen`
Please choose the fullscreen mode: (1) exclusive, (2) borderless: 2
Monitor #0: Some("HDMI-A-0")
Monitor #1: Some("VGA-0")
Please write the number of the monitor to use: 1
Using Some("VGA-0")
^C

Annoying, if you use exclusive mode, with a non-native video mode, the correct monitor will modify its resolution, but the window will still show up on display number 0.

cc @murarth

garasubo commented 4 years ago

I tested with GNOME in Ubuntu 18.04, the screen selection works correctly, but the resolution detection seems wrong. The window doesn't cover whole screen, and in the debug message, the resolution was always detected as 800x600 like this:

2020-05-15 17:14:46,196 INFO  [winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
2020-05-15 17:14:46,196 DEBUG [winit::platform_impl::platform::x11::window] Calculated physical dimensions: 800x600
cdknight commented 3 years ago

Interestingly, this same issue seems to occur when you enable override-redirect with .with_override_redirect(true) in the WindowBuilder.