Author: jimtabor Date: Sat Aug 18 23:01:55 2012 New Revision: 57104 URL: http://svn.reactos.org/svn/reactos?rev=57104&view=rev Log: [NtUser] - Patch based on Daniel Jelinski: search more aggressively for a window under a tooltip and better HTTRANSPARENT handling. When the test patch is applied, ReactOS passes the new tests.
References: http://www.winehq.org/pipermail/wine-patches/2012-July/116429.html http://www.winehq.org/pipermail/wine-patches/2012-August/116776.html http://www.winehq.org/pipermail/wine-patches/2012-August/116777.html http://www.winehq.org/pipermail/wine-devel/2012-August/096681.html Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c trunk/reactos/win32ss/user/ntuser/winpos.c Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgqueue.c?rev=57104&r1=57103&r2=57104&view=diff ============================================================================== --- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Sat Aug 18 23:01:55 2012 @@ -41,6 +41,12 @@ IntChildrenWindowFromPoint(PWND pWndTop, INT x, INT y) { PWND pWnd, pWndChild; + + if ( !pWndTop ) + { + pWndTop = UserGetDesktopWindow(); + if ( !pWndTop ) return NULL; + } if (!(pWndTop->style & WS_VISIBLE)) return NULL; if ((pWndTop->style & WS_DISABLED)) return NULL; @@ -1338,7 +1344,7 @@ pwndDesktop = UserGetDesktopWindow(); MessageQueue = pti->MessageQueue; CurInfo = IntGetSysCursorInfo(); - pwndMsg = UserGetWindowObject(msg->hwnd); + pwndMsg = ValidateHwndNoErr(msg->hwnd); clk_msg = MessageQueue->msgDblClk; pDesk = pwndDesktop->head.rpdesk; @@ -1350,8 +1356,9 @@ if (pwndMsg) UserReferenceObject(pwndMsg); } else - { - pwndMsg = co_WinPosWindowFromPoint(pwndMsg, &msg->pt, &hittest); + { // 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); } TRACE("Got mouse message for 0x%x, hittest: 0x%x\n", msg->hwnd, hittest ); Modified: trunk/reactos/win32ss/user/ntuser/winpos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos.c?rev=57104&r1=57103&r2=57104&view=diff ============================================================================== --- trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] Sat Aug 18 23:01:55 2012 @@ -2111,7 +2111,7 @@ { for (phWnd = List; *phWnd; ++phWnd) { - if (!(pwndChild = UserGetWindowObject(*phWnd))) + if (!(pwndChild = ValidateHwndNoErr(*phWnd))) { continue; } @@ -2130,13 +2130,18 @@ } } - *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0, - MAKELONG(Point->x, Point->y)); - if ((*HitTest) == (USHORT)HTTRANSPARENT) + if (ScopeWin->head.pti == PsGetCurrentThreadWin32Thread()) { - UserDereferenceObject(ScopeWin); - return NULL; + *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0, + MAKELONG(Point->x, Point->y)); + if ((*HitTest) == (USHORT)HTTRANSPARENT) + { + UserDereferenceObject(ScopeWin); + return NULL; + } } + else + *HitTest = HTCLIENT; return ScopeWin; } @@ -2163,7 +2168,7 @@ Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest); UserDerefObjectCo(ScopeWin); - if(Window) + if (Window) ASSERT_REFS_CO(Window); ASSERT_REFS_CO(ScopeWin); @@ -2193,7 +2198,7 @@ for (phWnd = List; *phWnd; phWnd++) { PWND Child; - if ((Child = UserGetWindowObject(*phWnd))) + if ((Child = ValidateHwndNoErr(*phWnd))) { if ( Child->style & WS_VISIBLE && IntPtInWindow(Child, Pt.x, Pt.y) ) { @@ -2238,7 +2243,7 @@ for (phWnd = List; *phWnd; phWnd++) { PWND Child; - if ((Child = UserGetWindowObject(*phWnd))) + if ((Child = ValidateHwndNoErr(*phWnd))) { if (uiFlags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED)) { @@ -3098,9 +3103,9 @@ //pti = PsGetCurrentThreadWin32Thread(); Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest); - if(Window) - { - Ret = Window->head.h; + if (Window) + { + Ret = UserHMGetHandle(Window); RETURN( Ret); }