From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 3 +-- dlls/winex11.drv/x11drv.h | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index a0b46fe1fd9..c377bbc9984 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1423,8 +1423,7 @@ static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt )
if (PtInRect( &tempRect, pt)) { - HWND ret = NtUserChildWindowFromPointEx( hQueryWnd, pt.x, pt.y, - CWP_SKIPINVISIBLE|CWP_SKIPDISABLED ); + HWND ret = child_window_from_point( hQueryWnd, pt.x, pt.y, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED ); if (ret && ret != hQueryWnd) { ret = find_drop_window( ret, lpPt ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 3485d239fa2..6d257a2afbd 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -903,6 +903,15 @@ static inline BOOL redraw_window( HWND hwnd, const RECT *rect, HRGN hrgn, UINT f return ret; }
+/* per-monitor DPI aware NtUserChildWindowFromPointEx call */ +static inline HWND child_window_from_point( HWND parent, LONG x, LONG y, UINT flags ) +{ + UINT context = NtUserSetThreadDpiAwarenessContext( NTUSER_DPI_PER_MONITOR_AWARE_V2 ); + HWND ret = NtUserChildWindowFromPointEx( parent, x, y, flags ); + NtUserSetThreadDpiAwarenessContext( context ); + return ret; +} + static inline HWND get_focus(void) { GUITHREADINFO info;