`AdjustWindowRect(Ex)` were using the system DPI even in non-DPI-aware applications, leading to some bizarre behavior.
An easy test for this is to remove the DPI awareness from `winemine`'s manifest, set the system DPI to 192, then run `winemine` and click the smiley face. Every click on the smiley face will move the window up by ~30 pixels.
A copy of ioquake3 with DPI awareness removed would also constantly enlarge its window vertically.
From: Brendan Shanks bshanks@codeweavers.com
--- dlls/user32/sysparams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index ea3bed29db4..a7ce2e54d35 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -1091,7 +1091,7 @@ LONG WINAPI SetDisplayConfig(UINT32 path_info_count, DISPLAYCONFIG_PATH_INFO *pa BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRect( RECT *rect, DWORD style, BOOL menu ) { TRACE( "(%s) %08lx %d\n", wine_dbgstr_rect( rect ), style, menu ); - return NtUserAdjustWindowRect( rect, style, menu, 0, system_dpi ); + return NtUserAdjustWindowRect( rect, style, menu, 0, GetDpiForSystem() ); }
@@ -1101,7 +1101,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRect( RECT *rect, DWORD style, BOOL me BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx( RECT *rect, DWORD style, BOOL menu, DWORD ex_style ) { TRACE( "(%s) %08lx %d %08lx\n", wine_dbgstr_rect( rect ), style, menu, ex_style ); - return NtUserAdjustWindowRect( rect, style, menu, ex_style, system_dpi ); + return NtUserAdjustWindowRect( rect, style, menu, ex_style, GetDpiForSystem() ); }
This merge request was approved by Rémi Bernon.