pub struct WindowConfiguration {
pub size: PhysicalSize,
pub scale_factor: f64,
pub mode: DisplayMode,
}Expand description
What the window system has actually told us about a window.
The three facts arrive together or not at all, which is why they are one
struct rather than three fields on WindowState. Every backend delivers
them as a single message — Wayland’s xdg_surface.configure, Win32’s
WM_DPICHANGED with its suggested rectangle, AppKit’s
windowDidChangeBackingProperties — and a consumer that could hold a size
from one configure and a scale from another would compute the wrong logical
size for exactly one frame, which is the kind of bug that gets closed as
“cannot reproduce”.
Fields§
§size: PhysicalSizeClient area in device pixels — what the swapchain must match.
scale_factor: f64Device pixels per logical unit for this window.
mode: DisplayModeThe mode actually in effect.
Not necessarily WindowState::requested_mode: a compositor may refuse
a fullscreen request, and a tiling window manager makes the whole
question moot. This is the answer, that is the question.