Author: jimtabor Date: Mon Mar 3 06:38:45 2014 New Revision: 62410
URL: http://svn.reactos.org/svn/reactos?rev=62410&view=rev Log: [WinSS] - Fix activate modal dialog when clicking on a disabled window (part 2) without zorder support. Other than clicking the tool bar, it will help activate the popup and bring it to the top. Panic mode support. - Adapt window from point to ignore disabled windows. Attempting to fill a code hole. See CORE-6651.
Modified: trunk/reactos/win32ss/user/ntuser/focus.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/focus.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.c... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] Mon Mar 3 06:38:45 2014 @@ -120,7 +120,7 @@ (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_IntMakeWindowActive(Window);
- /* FIXME: IntIsWindow */ - co_IntSendMessageNoWait( UserHMGetHandle(Window), WM_NCACTIVATE, (WPARAM)(Window == (gpqForeground ? gpqForeground->spwndActive : NULL)), @@ -552,9 +550,7 @@ 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 @@ PWND DesktopWindow = UserGetDesktopWindow(); if (DesktopWindow) { + ERR("Window Diabled\n"); Top = IntFindChildWindowToOwner(DesktopWindow, Wnd); if ((TopWnd = ValidateHwndNoErr(Top))) { @@ -576,15 +573,8 @@ } 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 @@ 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 @@ IntSendFocusMessages( pti, pWndSend); } } - + //// if (InAAPM) { pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG;
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] Mon Mar 3 06:38:45 2014 @@ -575,6 +575,7 @@ { 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 @@ USHORT hittest; EVENTMSG event; MOUSEHOOKSTRUCT hook; - BOOL eatMsg; + BOOL eatMsg = FALSE;
PWND pwndMsg, pwndDesktop; PUSER_MESSAGE_QUEUE MessageQueue; @@ -1367,9 +1368,8 @@ 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); @@ -1391,10 +1391,6 @@ }
msg->hwnd = UserHMGetHandle(pwndMsg); - -#if 0 - if (!check_hwnd_filter( msg, hwnd_filter )) RETURN(FALSE); -#endif
pt = msg->pt; message = msg->message; @@ -1546,8 +1542,6 @@ msg->message = message; RETURN(TRUE); } - - eatMsg = FALSE;
if ((msg->message == WM_LBUTTONDOWN) || (msg->message == WM_RBUTTONDOWN) || @@ -1807,8 +1801,7 @@ break; } } - CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, - ListEntry); + CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); } while(CurrentEntry != ListHead);
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] Mon Mar 3 06:38:45 2014 @@ -2440,7 +2440,8 @@ co_WinPosSearchChildren( PWND ScopeWin, POINT *Point, - USHORT *HitTest + USHORT *HitTest, + BOOL Ignore ) { PWND pwndChild; @@ -2451,7 +2452,7 @@ return NULL; }
- if ((ScopeWin->style & WS_DISABLED)) + if (!Ignore && (ScopeWin->style & WS_DISABLED)) { return NULL; } @@ -2475,7 +2476,7 @@ continue; }
- pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest); + pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest, Ignore);
if(pwndChild != NULL) { @@ -2506,7 +2507,7 @@ }
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 @@ 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 @@ UserRefObjectCo(DesktopWindow, &Ref);
//pti = PsGetCurrentThreadWin32Thread(); - Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest); + Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest, FALSE);
if (Window) {
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] Mon Mar 3 06:38:45 2014 @@ -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); +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);