From: Paul Gofman pgofman@codeweavers.com
--- dlls/win32u/window.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index afe68d08d53..7b761257306 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2207,6 +2207,7 @@ static BOOL expose_window_surface( HWND hwnd, UINT flags, const RECT *rect, UINT struct window_surface *surface; struct window_rects rects; RECT window_rect; + UINT win_dpi; WND *win;
if (!(win = get_win_ptr( hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; @@ -2216,8 +2217,12 @@ static BOOL expose_window_surface( HWND hwnd, UINT flags, const RECT *rect, UINT
if (rect) { - window_rect = map_dpi_rect( *rect, dpi, get_dpi_for_window( hwnd ) ); - InflateRect( &window_rect, 1, 1 ); /* compensate rounding errors */ + if ((win_dpi = get_dpi_for_window( hwnd )) != dpi) + { + window_rect = map_dpi_rect( *rect, dpi, win_dpi ); + InflateRect( &window_rect, 1, 1 ); /* compensate rounding errors */ + } + else window_rect = *rect; }
if (!surface || surface == &dummy_surface)