}
}
-PWND FASTCALL
-co_IntFindChildWindowToOwner(PWND Root, PWND Owner)
-{
- PWND Ret;
- PWND Child, OwnerWnd;
-
- for(Child = Root->spwndChild; Child; Child = Child->spwndNext)
- {
- OwnerWnd = Child->spwndOwner;
- if(!OwnerWnd)
- continue;
-
- if(OwnerWnd == Owner)
- {
- Ret = Child;
- return Ret;
- }
- }
- return NULL;
-}
-
BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT last)
{
MSG clk_msg;
MOUSEHOOKSTRUCT hook;
BOOL eatMsg = FALSE;
- PWND pwndMsg, pwndDesktop, pwndPopUP;
+ PWND pwndMsg, pwndDesktop, pwndOrig;
PUSER_MESSAGE_QUEUE MessageQueue;
PTHREADINFO pti;
PSYSTEM_CURSORINFO CurInfo;
pwndDesktop = UserGetDesktopWindow();
MessageQueue = pti->MessageQueue;
CurInfo = IntGetSysCursorInfo();
- pwndPopUP = pwndMsg = ValidateHwndNoErr(msg->hwnd);
+ pwndOrig = pwndMsg = ValidateHwndNoErr(msg->hwnd);
clk_msg = MessageQueue->msgDblClk;
pDesk = pwndDesktop->head.rpdesk;
*/
pwndMsg = co_WinPosWindowFromPoint( NULL, &msg->pt, &hittest, FALSE);
//
- // CORE-6129, Override if a diabled window with a visible popup was selected.
+ // CORE-6129, Override if a diabled window, it might have a visible popup.
//
- if (pwndPopUP && pwndPopUP->style & WS_DISABLED)
+ if ( pwndOrig && pwndOrig->style & WS_DISABLED )
{
- TRACE("window disabled\n");
- pwndPopUP = co_IntFindChildWindowToOwner(UserGetDesktopWindow(), pwndPopUP);
- if ( pwndPopUP &&
- pwndPopUP->style & WS_POPUP &&
- pwndPopUP->style & WS_VISIBLE &&
- (pwndPopUP->head.pti->MessageQueue != gpqForeground ||
- pwndPopUP->head.pti->MessageQueue->spwndActive != pwndPopUP) &&
- //pwndPopUP != pwndPopUP->head.rpdesk->pDeskInfo->spwndShell needs testing.
- pwndPopUP != ValidateHwndNoErr(InputWindowStation->ShellWindow) )
+ if ( hittest == (USHORT)HTERROR )
{
- TRACE("Found Popup!\n");
- UserDereferenceObject(pwndMsg);
- pwndMsg = pwndPopUP;
+ if (pwndMsg) UserReferenceObject(pwndMsg);
+ pwndMsg = pwndOrig;
UserReferenceObject(pwndMsg);
}
}
pt = msg->pt;
message = msg->message;
+
/* Note: windows has no concept of a non-client wheel message */
if (message != WM_MOUSEWHEEL)
{
RETURN(FALSE);
}
- if ((hittest == HTERROR) || (hittest == HTNOWHERE))
+ if ((hittest == (USHORT)HTERROR) || (hittest == (USHORT)HTNOWHERE))
{
- co_IntSendMessage( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd,
- MAKELONG( hittest, msg->message ));
-
+ 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);
PWND pwndTop = pwndMsg;
pwndTop = IntGetNonChildAncestor(pwndTop);
+ TRACE("Mouse pti %p pwndMsg pti %p pwndTop pti %p\n",MessageQueue->ptiMouse,pwndMsg->head.pti,pwndTop->head.pti);
+
if (pwndTop && pwndTop != pwndDesktop)
{
LONG ret = co_IntSendMessage( msg->hwnd,
{
WndTo = Wnd->head.pti->MessageQueue->spwndActivePrev;
if (can_activate_window( WndTo )) goto done;
-
}
// Find any window to bring to top. Works Okay for wine since it does not see X11 windows.
return(WasVisible);
}
-static
-PWND FASTCALL
+static PWND
co_WinPosSearchChildren(
- PWND ScopeWin,
- POINT *Point,
- USHORT *HitTest,
- BOOL Ignore
+ IN PWND ScopeWin,
+ IN POINT *Point,
+ IN OUT USHORT *HitTest,
+ IN BOOL Ignore
)
{
PWND pwndChild;
if (!Ignore && (ScopeWin->style & WS_DISABLED))
{
+ *HitTest = HTERROR;
return NULL;
}
if (ScopeWin->head.pti == PsGetCurrentThreadWin32Thread())
{
- *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0,
- MAKELONG(Point->x, Point->y));
+ *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0, MAKELONG(Point->x, Point->y));
+
if ((*HitTest) == (USHORT)HTTRANSPARENT)
{
UserDereferenceObject(ScopeWin);
}
}
else
- *HitTest = HTCLIENT;
+ {
+ if (*HitTest == HTNOWHERE && pwndChild == NULL) *HitTest = HTCLIENT;
+ }
return ScopeWin;
}
-PWND FASTCALL
-co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore)
+PWND APIENTRY
+co_WinPosWindowFromPoint(IN PWND ScopeWin, IN POINT *WinPoint, IN OUT USHORT* HitTest, IN BOOL Ignore)
{
PWND Window;
POINT Point = *WinPoint;
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags);
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Window, INT Cmd);
void FASTCALL co_WinPosSendSizeMove(PWND Window);
-PWND FASTCALL co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore);
+PWND APIENTRY co_WinPosWindowFromPoint(IN PWND ScopeWin, IN POINT *WinPoint, IN OUT USHORT* HitTest, IN BOOL Ignore);
VOID FASTCALL co_WinPosActivateOtherWindow(PWND);
PWND FASTCALL IntRealChildWindowFromPoint(PWND,LONG,LONG);
BOOL FASTCALL IntScreenToClient(PWND,LPPOINT);