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 9e5099f05ee..69e82713520 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2226,6 +2226,7 @@ static BOOL expose_window_surface( HWND hwnd, UINT flags, const RECT *rect, UINT struct window_rects rects; RECT window_rect; HRGN region = 0; + UINT win_dpi; WND *win;
if (!(win = get_win_ptr( hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; @@ -2235,8 +2236,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)