bevy_winit: Window centering is incorrect when the primary monitor's usable space differs from the intended monitor's #17838
Labels
A-Windowing
Platform-agnostic interface layer to run your app in
C-Bug
An unexpected or incorrect behavior
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
Bevy version
Bevy version 0.15.1
What you did
I created a window with
WindowPosition::Centered
and positioned it on my secondary monitor. I noticed the window appears off-center when the primary monitor has a Gnome top bar and the secondary monitor doesn't.My setup:
What went wrong
Expected:
The window should be perfectly centered on the secondary monitor since it has the full 1920x1080 space available.
Actual:
The window sits too low on the screen, there's more space at the top than at the bottom. I measured the offset and it's exactly 16 pixels, which interestingly is half the height of the Gnome top bar from my primary monitor.
Additional information
I think I found where this happens in
winit_windows.rs
in thewinit_window_position()
function. Here's my theory of what's going on:Here's the code where I think this happens (I removed the original comments and added my explanation):
The text was updated successfully, but these errors were encountered: