1
0
Fork 0

Add missing AdjustWindowRectEx() for resize

This commit is contained in:
Robbert van der Helm 2023-01-01 23:43:04 +01:00
parent be5238ec46
commit 425ee7ac35

View file

@ -489,14 +489,23 @@ impl WindowState {
*window_info *window_info
}; };
// If the window is a standalone window then the size needs to include the window
// decorations
let mut rect = RECT {
left: 0,
top: 0,
right: window_info.physical_size().width as i32,
bottom: window_info.physical_size().height as i32,
};
unsafe { unsafe {
AdjustWindowRectEx(&mut rect, self.dw_style, 0, 0);
SetWindowPos( SetWindowPos(
self.hwnd, self.hwnd,
self.hwnd, self.hwnd,
0, 0,
0, 0,
window_info.physical_size().width as i32, rect.right - rect.left,
window_info.physical_size().height as i32, rect.bottom - rect.top,
SWP_NOZORDER | SWP_NOMOVE, SWP_NOZORDER | SWP_NOMOVE,
) )
}; };