continue;
}
- if ((pWnd->style & WS_VISIBLE) && IntPtInWindow(pWnd, x, y))
+ if ((pWnd->style & WS_VISIBLE) &&
+ (pWnd->ExStyle & (WS_EX_LAYERED|WS_EX_TRANSPARENT)) == 0 &&
+ IntPtInWindow(pWnd, x, y))
return pWnd;
}
MOUSEHOOKSTRUCT hook;
BOOL eatMsg = FALSE;
- PWND pwndMsg, pwndDesktop, pwndOrig;
+ PWND pwndMsg, pwndDesktop;
PUSER_MESSAGE_QUEUE MessageQueue;
PTHREADINFO pti;
PSYSTEM_CURSORINFO CurInfo;
PDESKTOP pDesk;
- DECLARE_RETURN(BOOL);
pti = PsGetCurrentThreadWin32Thread();
pwndDesktop = UserGetDesktopWindow();
MessageQueue = pti->MessageQueue;
CurInfo = IntGetSysCursorInfo();
- pwndOrig = pwndMsg = ValidateHwndNoErr(msg->hwnd);
+ pwndMsg = ValidateHwndNoErr(msg->hwnd);
clk_msg = MessageQueue->msgDblClk;
pDesk = pwndDesktop->head.rpdesk;
{
hittest = HTCLIENT;
pwndMsg = MessageQueue->spwndCapture;
- if (pwndMsg) UserReferenceObject(pwndMsg);
}
else
{
Start with null window. See wine win.c:test_mouse_input:WM_COMMAND tests.
*/
pwndMsg = co_WinPosWindowFromPoint( NULL, &msg->pt, &hittest, FALSE);
- //
- // CORE-6129, Override if a diabled window, it might have a visible popup.
- //
- if ( pwndOrig && pwndOrig->style & WS_DISABLED )
- {
- if ( hittest == (USHORT)HTERROR )
- {
- if (pwndMsg) UserReferenceObject(pwndMsg);
- pwndMsg = pwndOrig;
- UserReferenceObject(pwndMsg);
- }
- }
}
TRACE("Got mouse message for %p, hittest: 0x%x\n", msg->hwnd, hittest);
{
/* Remove and ignore the message */
*RemoveMessages = TRUE;
- RETURN(FALSE);
+ return FALSE;
}
if ( MessageQueue == gpqCursor ) // Cursor must use the same Queue!
if (!((first == 0 && last == 0) || (message >= first || message <= last)))
{
TRACE("Message out of range!!!\n");
- RETURN(FALSE);
+ return FALSE;
}
/* update static double click conditions */
if (!((first == 0 && last == 0) || (message >= first || message <= last)))
{
TRACE("Message out of range!!!\n");
- RETURN(FALSE);
+ return FALSE;
}
// Update mouse move down keys.
}
}
- if(gspv.bMouseClickLock)
+ if (gspv.bMouseClickLock)
{
BOOL IsClkLck = FALSE;
/* Remove and ignore the message */
*RemoveMessages = TRUE;
TRACE("Remove and ignore the message\n");
- RETURN(FALSE);
+ return FALSE;
}
}
- /* message is accepted now (but may still get dropped) */
+ /* message is accepted now (but still get dropped) */
event.message = msg->message;
event.time = msg->time;
/* Remove and skip message */
*RemoveMessages = TRUE;
- RETURN(FALSE);
+ return FALSE;
}
if ((hittest == (USHORT)HTERROR) || (hittest == (USHORT)HTNOWHERE))
{
co_IntSendMessage( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd, MAKELONG( hittest, msg->message ));
- ERR("HT errors!\n");
+
/* Remove and skip message */
*RemoveMessages = TRUE;
- RETURN(FALSE);
+ return FALSE;
}
if ((*RemoveMessages == FALSE) || MessageQueue->spwndCapture)
{
/* Accept the message */
msg->message = message;
- RETURN(TRUE);
+ return TRUE;
}
if ((msg->message == WM_LBUTTONDOWN) ||
co_IntSendMessage( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd, MAKELONG( hittest, msg->message ));
msg->message = message;
- RETURN(!eatMsg);
-
-CLEANUP:
- if(pwndMsg)
- UserDereferenceObject(pwndMsg);
-
- END_CLEANUP;
+ return !eatMsg;
}
BOOL co_IntProcessKeyboardMessage(MSG* Msg, BOOL* RemoveMessages)
IN BOOL Ignore
)
{
- PWND pwndChild;
HWND *List, *phWnd;
+ PWND pwndChild = NULL;
+ /* not visible */
if (!(ScopeWin->style & WS_VISIBLE))
{
return NULL;
}
- if (!Ignore && (ScopeWin->style & WS_DISABLED))
+ /* not in window or in window region */
+ if (!IntPtInWindow(ScopeWin, Point->x, Point->y))
{
- *HitTest = HTERROR;
return NULL;
}
- if (!IntPtInWindow(ScopeWin, Point->x, Point->y))
+ /* transparent */
+ if ((ScopeWin->ExStyle & (WS_EX_LAYERED|WS_EX_TRANSPARENT)) == (WS_EX_LAYERED|WS_EX_TRANSPARENT))
{
return NULL;
}
- UserReferenceObject(ScopeWin);
+ if (!Ignore && (ScopeWin->style & WS_DISABLED))
+ { /* disabled child */
+ if ((ScopeWin->style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return NULL;
+ /* process the hit error */
+ *HitTest = HTERROR;
+ return ScopeWin;
+ }
- if (RECTL_bPointInRect(&ScopeWin->rcClient, Point->x, Point->y))
+ /* not minimized and check if point is inside the window */
+ if (!(ScopeWin->style & WS_MINIMIZE) &&
+ RECTL_bPointInRect(&ScopeWin->rcClient, Point->x, Point->y) )
{
+ UserReferenceObject(ScopeWin);
+
List = IntWinListChildren(ScopeWin);
if (List)
{
}
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
}
+ UserDereferenceObject(ScopeWin);
}
if (ScopeWin->head.pti == PsGetCurrentThreadWin32Thread())
if ((*HitTest) == (USHORT)HTTRANSPARENT)
{
- UserDereferenceObject(ScopeWin);
return NULL;
}
}
else
{
- if (*HitTest == HTNOWHERE) *HitTest = HTCLIENT;
+ if (*HitTest == HTNOWHERE && pwndChild == NULL) *HitTest = HTCLIENT;
}
return ScopeWin;
}
PWND APIENTRY
-co_WinPosWindowFromPoint(IN PWND ScopeWin, IN POINT *WinPoint, IN OUT USHORT* HitTest, IN BOOL Ignore)
+co_WinPosWindowFromPoint(
+ IN PWND ScopeWin,
+ IN POINT *WinPoint,
+ IN OUT USHORT* HitTest,
+ IN BOOL Ignore)
{
PWND Window;
POINT Point = *WinPoint;
RETURN( NULL);
CLEANUP:
- if (Window) UserDereferenceObject(Window);
if (DesktopWindow) UserDerefObjectCo(DesktopWindow);
TRACE("Leave NtUserWindowFromPoint, ret=%p\n", _ret_);