From b00c0124b90be3bb83456dc59f87f6be8be74352 Mon Sep 17 00:00:00 2001 From: Huw D M Davies Date: Mon, 7 Aug 2000 17:10:39 +0000 Subject: [PATCH] WINPOS_WindowFromPoint should respect hrgnWnd. --- windows/winpos.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/windows/winpos.c b/windows/winpos.c index 06f2f251071..013dd9055d0 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -438,6 +438,7 @@ INT16 WINPOS_WindowFromPoint( WND* wndScope, POINT16 pt, WND **ppWnd ) INT16 retvalue; POINT16 xy = pt; + TRACE("scope %04x %d,%d\n", wndScope->hwndSelf, pt.x, pt.y); *ppWnd = NULL; wndPtr = WIN_LockWndPtr(wndScope->child); @@ -466,14 +467,18 @@ INT16 WINPOS_WindowFromPoint( WND* wndScope, POINT16 pt, WND **ppWnd ) /* is enabled (or it's a top-level window), then explore */ /* its children. Otherwise, go to the next window. */ - if ((wndPtr->dwStyle & WS_VISIBLE) && + if ((wndPtr->dwStyle & WS_VISIBLE) && (!(wndPtr->dwStyle & WS_DISABLED) || ((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)) && - (xy.x >= wndPtr->rectWindow.left) && - (xy.x < wndPtr->rectWindow.right) && - (xy.y >= wndPtr->rectWindow.top) && - (xy.y < wndPtr->rectWindow.bottom)) + (wndPtr->hrgnWnd ? + PtInRegion(wndPtr->hrgnWnd, xy.x - wndPtr->rectWindow.left, + xy.y - wndPtr->rectWindow.top) : + ((xy.x >= wndPtr->rectWindow.left) && + (xy.x < wndPtr->rectWindow.right) && + (xy.y >= wndPtr->rectWindow.top) && + (xy.y < wndPtr->rectWindow.bottom)))) { + TRACE("%d,%d is inside %04x\n", xy.x, xy.y, wndPtr->hwndSelf); *ppWnd = wndPtr; /* Got a suitable window */ /* If window is minimized or disabled, return at once */ @@ -517,7 +522,7 @@ hittest: { retvalue = hittest; /* Found the window */ goto end; - } + } } else {