diff --git a/reactos/win32ss/user/ntuser/focus.c b/reactos/win32ss/user/ntuser/focus.c index 8c6973feb49..bf1a32d259d 100644 --- a/reactos/win32ss/user/ntuser/focus.c +++ b/reactos/win32ss/user/ntuser/focus.c @@ -120,7 +120,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO (WPARAM)UserHMGetHandle(Window), 0); } - //// Fixes bug 7089. + //// Fixes CORE-6434. if (!(Window->style & WS_CHILD)) { PWND pwndTemp = co_GetDesktopWindow(Window)->spwndChild; @@ -229,8 +229,6 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO co_IntMakeWindowActive(Window); - /* FIXME: IntIsWindow */ - co_IntSendMessageNoWait( UserHMGetHandle(Window), WM_NCACTIVATE, (WPARAM)(Window == (gpqForeground ? gpqForeground->spwndActive : NULL)), @@ -552,9 +550,7 @@ BOOL FASTCALL co_IntMouseActivateWindow(PWND Wnd) { HWND Top; - PWND TopWindow; USER_REFERENCE_ENTRY Ref; - ASSERT_REFS_CO(Wnd); if (Wnd->style & WS_DISABLED) @@ -564,6 +560,7 @@ co_IntMouseActivateWindow(PWND Wnd) PWND DesktopWindow = UserGetDesktopWindow(); if (DesktopWindow) { + ERR("Window Diabled\n"); Top = IntFindChildWindowToOwner(DesktopWindow, Wnd); if ((TopWnd = ValidateHwndNoErr(Top))) { @@ -576,15 +573,8 @@ co_IntMouseActivateWindow(PWND Wnd) } return FALSE; } - - TopWindow = UserGetAncestor(Wnd, GA_ROOT); - //if (TopWindow) {ERR("MAW 2 pWnd %p hWnd %p\n",TopWindow,TopWindow->head.h);} - if (!TopWindow) return FALSE; - - /* TMN: Check return value from this function? */ - UserRefObjectCo(TopWindow, &Ref); - co_IntSetForegroundAndFocusWindow(TopWindow, TRUE); - UserDerefObjectCo(TopWindow); + ERR("Mouse Active\n"); + co_IntSetForegroundAndFocusWindow(Wnd, TRUE); return TRUE; } @@ -733,6 +723,7 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL, BOOL bMouse, BOOL bFocus, BOOL Async) InAAPM = co_IntSendActivateMessages(WndPrev, Wnd, bMouse, Async); /* now change focus if necessary */ + //// Fixes CORE-6452 allows setting focus on window. if (bFocus && !(ThreadQueue->QF_flags & QF_FOCUSNULLSINCEACTIVE)) { /* Do not change focus if the window is no longer active */ @@ -745,7 +736,7 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL, BOOL bMouse, BOOL bFocus, BOOL Async) IntSendFocusMessages( pti, pWndSend); } } - + //// if (InAAPM) { pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG; diff --git a/reactos/win32ss/user/ntuser/msgqueue.c b/reactos/win32ss/user/ntuser/msgqueue.c index f4475111ded..e6f31cb62b4 100644 --- a/reactos/win32ss/user/ntuser/msgqueue.c +++ b/reactos/win32ss/user/ntuser/msgqueue.c @@ -575,6 +575,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook { pti = pwnd->head.pti; MessageQueue = pti->MessageQueue; + // MessageQueue->ptiMouse = pti; if ( pti->TIF_flags & TIF_INCLEANUP || MessageQueue->QF_flags & QF_INDESTROY) { @@ -1342,7 +1343,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT USHORT hittest; EVENTMSG event; MOUSEHOOKSTRUCT hook; - BOOL eatMsg; + BOOL eatMsg = FALSE; PWND pwndMsg, pwndDesktop; PUSER_MESSAGE_QUEUE MessageQueue; @@ -1367,9 +1368,8 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT if (pwndMsg) UserReferenceObject(pwndMsg); } else - { // Fix wine Msg test_HTTRANSPARENT. Start with a NULL window. - // http://www.winehq.org/pipermail/wine-patches/2012-August/116776.html - pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest); + { + pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest, TRUE); } TRACE("Got mouse message for %p, hittest: 0x%x\n", msg->hwnd, hittest); @@ -1392,10 +1392,6 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT msg->hwnd = UserHMGetHandle(pwndMsg); -#if 0 - if (!check_hwnd_filter( msg, hwnd_filter )) RETURN(FALSE); -#endif - pt = msg->pt; message = msg->message; /* Note: windows has no concept of a non-client wheel message */ @@ -1547,8 +1543,6 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT RETURN(TRUE); } - eatMsg = FALSE; - if ((msg->message == WM_LBUTTONDOWN) || (msg->message == WM_RBUTTONDOWN) || (msg->message == WM_MBUTTONDOWN) || @@ -1807,8 +1801,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti, break; } } - CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, - ListEntry); + CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); } while(CurrentEntry != ListHead); diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index 7919b9a0639..5ad490abfb6 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -2440,7 +2440,8 @@ PWND FASTCALL co_WinPosSearchChildren( PWND ScopeWin, POINT *Point, - USHORT *HitTest + USHORT *HitTest, + BOOL Ignore ) { PWND pwndChild; @@ -2451,7 +2452,7 @@ co_WinPosSearchChildren( return NULL; } - if ((ScopeWin->style & WS_DISABLED)) + if (!Ignore && (ScopeWin->style & WS_DISABLED)) { return NULL; } @@ -2475,7 +2476,7 @@ co_WinPosSearchChildren( continue; } - pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest); + pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest, Ignore); if(pwndChild != NULL) { @@ -2506,7 +2507,7 @@ co_WinPosSearchChildren( } PWND FASTCALL -co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest) +co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore) { PWND Window; POINT Point = *WinPoint; @@ -2524,7 +2525,7 @@ co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest) ASSERT_REFS_CO(ScopeWin); UserRefObjectCo(ScopeWin, &Ref); - Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest); + Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest, Ignore); UserDerefObjectCo(ScopeWin); if (Window) @@ -3447,7 +3448,7 @@ NtUserWindowFromPoint(LONG X, LONG Y) UserRefObjectCo(DesktopWindow, &Ref); //pti = PsGetCurrentThreadWin32Thread(); - Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest); + Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest, FALSE); if (Window) { diff --git a/reactos/win32ss/user/ntuser/winpos.h b/reactos/win32ss/user/ntuser/winpos.h index adfaa32c17d..ed3464cf19d 100644 --- a/reactos/win32ss/user/ntuser/winpos.h +++ b/reactos/win32ss/user/ntuser/winpos.h @@ -52,7 +52,7 @@ UINT FASTCALL co_WinPosMinMaximize(PWND WindowObject, UINT ShowFlag, RECTL* NewP 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); +PWND FASTCALL co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore); VOID FASTCALL co_WinPosActivateOtherWindow(PWND); PWND FASTCALL IntRealChildWindowFromPoint(PWND,LONG,LONG); BOOL FASTCALL IntScreenToClient(PWND,LPPOINT);