winit-win32: prevent inner size reported as (0,0) when minimized

This commit is contained in:
Diggory Hardy
2025-11-01 14:39:57 +00:00
committed by GitHub
parent 9d9d21cfdb
commit a9c189a423
5 changed files with 37 additions and 10 deletions

View File

@@ -509,14 +509,7 @@ impl CoreWindow for Window {
}
fn surface_size(&self) -> PhysicalSize<u32> {
let mut rect: RECT = unsafe { mem::zeroed() };
if unsafe { GetClientRect(self.hwnd(), &mut rect) } == false.into() {
panic!(
"Unexpected GetClientRect failure: please report this error to \
rust-windowing/winit"
)
}
PhysicalSize::new((rect.right - rect.left) as u32, (rect.bottom - rect.top) as u32)
self.window_state_lock().surface_size
}
fn outer_size(&self) -> PhysicalSize<u32> {