Rémi Bernon : winewayland: Force thread DPI awareness when calling NtUserSetWindowPos.
Module: wine Branch: master Commit: b914409514b108be60da4cc2668d5d8434ebff10 URL: https://gitlab.winehq.org/wine/wine/-/commit/b914409514b108be60da4cc2668d5d8... Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 10 10:30:29 2024 +0200 winewayland: Force thread DPI awareness when calling NtUserSetWindowPos. --- dlls/winewayland.drv/window.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 73bee46cc35..274ce24db4c 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -46,6 +46,16 @@ static UINT get_win_monitor_dpi(HWND hwnd) } +/* per-monitor DPI aware NtUserSetWindowPos call */ +static BOOL set_window_pos(HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags) +{ + UINT context = NtUserSetThreadDpiAwarenessContext(NTUSER_DPI_PER_MONITOR_AWARE_V2); + BOOL ret = NtUserSetWindowPos(hwnd, after, x, y, cx, cy, flags); + NtUserSetThreadDpiAwarenessContext(context); + return ret; +} + + /* private window data */ struct wayland_win_data { @@ -628,7 +638,7 @@ static void wayland_configure_window(HWND hwnd) flags |= SWP_NOSENDCHANGING; } - NtUserSetWindowPos(hwnd, 0, 0, 0, window_width, window_height, flags); + set_window_pos(hwnd, 0, 0, 0, window_width, window_height, flags); } /**********************************************************************
participants (1)
-
Alexandre Julliard