winex11: Force thread DPI awareness when calling NtUserChildWindowFromPointEx.

This commit is contained in:
Rémi Bernon 2024-06-10 11:36:12 +02:00 committed by Alexandre Julliard
parent 949920810a
commit 0bc571657e
2 changed files with 10 additions and 2 deletions

View file

@ -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 );

View file

@ -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;