Author: jimtabor Date: Thu Jan 22 23:31:22 2015 New Revision: 66078
URL: http://svn.reactos.org/svn/reactos?rev=66078&view=rev Log: [Win32ss] - Plugging in the real fix for CORE-6129! - Works like it should, but CMD properties window gets active when it should not. See CORE-6651.
Modified: trunk/reactos/win32ss/user/ntuser/defwnd.c trunk/reactos/win32ss/user/ntuser/msgqueue.c trunk/reactos/win32ss/user/ntuser/winpos.c trunk/reactos/win32ss/user/ntuser/winpos.h
Modified: trunk/reactos/win32ss/user/ntuser/defwnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/defwnd.... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/defwnd.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/defwnd.c [iso-8859-1] Thu Jan 22 23:31:22 2015 @@ -754,6 +754,29 @@ return(Hook ? 1 : 0); // Don't call us again from user space. }
+#if 0 // Keep it for later! +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; +} +#endif + VOID FASTCALL DefWndPrint( PWND pwnd, HDC hdc, ULONG uFlags) { /*
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgqueu... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Thu Jan 22 23:31:22 2015 @@ -1466,27 +1466,6 @@ } }
-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; @@ -1497,7 +1476,7 @@ MOUSEHOOKSTRUCT hook; BOOL eatMsg = FALSE;
- PWND pwndMsg, pwndDesktop, pwndPopUP; + PWND pwndMsg, pwndDesktop, pwndOrig; PUSER_MESSAGE_QUEUE MessageQueue; PTHREADINFO pti; PSYSTEM_CURSORINFO CurInfo; @@ -1508,7 +1487,7 @@ 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;
@@ -1526,23 +1505,14 @@ */ 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); } } @@ -1571,6 +1541,7 @@
pt = msg->pt; message = msg->message; + /* Note: windows has no concept of a non-client wheel message */ if (message != WM_MOUSEWHEEL) { @@ -1711,11 +1682,10 @@ RETURN(FALSE); }
- if ((hittest == HTERROR) || (hittest == HTNOWHERE)) - { - co_IntSendMessage( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd, - MAKELONG( hittest, msg->message )); - + 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); @@ -1745,6 +1715,8 @@ { 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) {
Modified: trunk/reactos/win32ss/user/ntuser/winpos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos.... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] Thu Jan 22 23:31:22 2015 @@ -349,7 +349,6 @@ { 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. @@ -2410,13 +2409,12 @@ 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; @@ -2429,6 +2427,7 @@
if (!Ignore && (ScopeWin->style & WS_DISABLED)) { + *HitTest = HTERROR; return NULL; }
@@ -2467,8 +2466,8 @@
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); @@ -2476,13 +2475,15 @@ } } 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;
Modified: trunk/reactos/win32ss/user/ntuser/winpos.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos.... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/winpos.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winpos.h [iso-8859-1] Thu Jan 22 23:31:22 2015 @@ -52,7 +52,7 @@ 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);