From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 2 +- dlls/winex11.drv/window.c | 5 ++--- dlls/winex11.drv/x11drv.h | 9 +++++++++ 3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 7adb083134c..a0b46fe1fd9 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -931,7 +931,7 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev )
release_win_data( data );
- if (flags) NtUserRedrawWindow( hwnd, &rect, surface_region, flags ); + if (flags) redraw_window( hwnd, &rect, surface_region, flags ); if (surface_region) NtGdiDeleteObjectApp( surface_region ); return TRUE; } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 39a8d2a4b5d..845cd896bb0 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1551,10 +1551,9 @@ static void move_window_bits( HWND hwnd, Window window, const RECT *old_rect, co /* map region to client rect since we are using DCX_WINDOW */ NtGdiOffsetRgn( rgn, new_window_rect->left - new_client_rect->left, new_window_rect->top - new_client_rect->top ); - NtUserRedrawWindow( hwnd, NULL, rgn, - RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN ); + redraw_window( hwnd, NULL, rgn, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN ); } - else NtUserRedrawWindow( hwnd, NULL, rgn, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN ); + else redraw_window( hwnd, NULL, rgn, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN ); NtGdiDeleteObjectApp( rgn ); } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 055b1a9be8b..3485d239fa2 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -894,6 +894,15 @@ static inline BOOL set_window_pos( HWND hwnd, HWND after, INT x, INT y, INT cx, return ret; }
+/* per-monitor DPI aware NtUserRedrawWindow call */ +static inline BOOL redraw_window( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags ) +{ + UINT context = NtUserSetThreadDpiAwarenessContext( NTUSER_DPI_PER_MONITOR_AWARE_V2 ); + BOOL ret = NtUserRedrawWindow( hwnd, rect, hrgn, flags ); + NtUserSetThreadDpiAwarenessContext( context ); + return ret; +} + static inline HWND get_focus(void) { GUITHREADINFO info;