- 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.

svn path=/trunk/; revision=62410
This commit is contained in:
James Tabor 2014-03-03 06:38:45 +00:00
parent 6e275a78d2
commit 6334f63dbc
4 changed files with 19 additions and 34 deletions

View file

@ -120,7 +120,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
(WPARAM)UserHMGetHandle(Window), (WPARAM)UserHMGetHandle(Window),
0); 0);
} }
//// Fixes bug 7089. //// Fixes CORE-6434.
if (!(Window->style & WS_CHILD)) if (!(Window->style & WS_CHILD))
{ {
PWND pwndTemp = co_GetDesktopWindow(Window)->spwndChild; PWND pwndTemp = co_GetDesktopWindow(Window)->spwndChild;
@ -229,8 +229,6 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
co_IntMakeWindowActive(Window); co_IntMakeWindowActive(Window);
/* FIXME: IntIsWindow */
co_IntSendMessageNoWait( UserHMGetHandle(Window), co_IntSendMessageNoWait( UserHMGetHandle(Window),
WM_NCACTIVATE, WM_NCACTIVATE,
(WPARAM)(Window == (gpqForeground ? gpqForeground->spwndActive : NULL)), (WPARAM)(Window == (gpqForeground ? gpqForeground->spwndActive : NULL)),
@ -552,9 +550,7 @@ BOOL FASTCALL
co_IntMouseActivateWindow(PWND Wnd) co_IntMouseActivateWindow(PWND Wnd)
{ {
HWND Top; HWND Top;
PWND TopWindow;
USER_REFERENCE_ENTRY Ref; USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(Wnd); ASSERT_REFS_CO(Wnd);
if (Wnd->style & WS_DISABLED) if (Wnd->style & WS_DISABLED)
@ -564,6 +560,7 @@ co_IntMouseActivateWindow(PWND Wnd)
PWND DesktopWindow = UserGetDesktopWindow(); PWND DesktopWindow = UserGetDesktopWindow();
if (DesktopWindow) if (DesktopWindow)
{ {
ERR("Window Diabled\n");
Top = IntFindChildWindowToOwner(DesktopWindow, Wnd); Top = IntFindChildWindowToOwner(DesktopWindow, Wnd);
if ((TopWnd = ValidateHwndNoErr(Top))) if ((TopWnd = ValidateHwndNoErr(Top)))
{ {
@ -576,15 +573,8 @@ co_IntMouseActivateWindow(PWND Wnd)
} }
return FALSE; return FALSE;
} }
ERR("Mouse Active\n");
TopWindow = UserGetAncestor(Wnd, GA_ROOT); co_IntSetForegroundAndFocusWindow(Wnd, TRUE);
//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);
return 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); InAAPM = co_IntSendActivateMessages(WndPrev, Wnd, bMouse, Async);
/* now change focus if necessary */ /* now change focus if necessary */
//// Fixes CORE-6452 allows setting focus on window.
if (bFocus && !(ThreadQueue->QF_flags & QF_FOCUSNULLSINCEACTIVE)) if (bFocus && !(ThreadQueue->QF_flags & QF_FOCUSNULLSINCEACTIVE))
{ {
/* Do not change focus if the window is no longer active */ /* 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); IntSendFocusMessages( pti, pWndSend);
} }
} }
////
if (InAAPM) if (InAAPM)
{ {
pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG; pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG;

View file

@ -575,6 +575,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook
{ {
pti = pwnd->head.pti; pti = pwnd->head.pti;
MessageQueue = pti->MessageQueue; MessageQueue = pti->MessageQueue;
// MessageQueue->ptiMouse = pti;
if ( pti->TIF_flags & TIF_INCLEANUP || MessageQueue->QF_flags & QF_INDESTROY) 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; USHORT hittest;
EVENTMSG event; EVENTMSG event;
MOUSEHOOKSTRUCT hook; MOUSEHOOKSTRUCT hook;
BOOL eatMsg; BOOL eatMsg = FALSE;
PWND pwndMsg, pwndDesktop; PWND pwndMsg, pwndDesktop;
PUSER_MESSAGE_QUEUE MessageQueue; PUSER_MESSAGE_QUEUE MessageQueue;
@ -1367,9 +1368,8 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT
if (pwndMsg) UserReferenceObject(pwndMsg); if (pwndMsg) UserReferenceObject(pwndMsg);
} }
else 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, TRUE);
pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest);
} }
TRACE("Got mouse message for %p, hittest: 0x%x\n", msg->hwnd, hittest); 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); msg->hwnd = UserHMGetHandle(pwndMsg);
#if 0
if (!check_hwnd_filter( msg, hwnd_filter )) RETURN(FALSE);
#endif
pt = msg->pt; pt = msg->pt;
message = msg->message; message = msg->message;
/* Note: windows has no concept of a non-client wheel 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); RETURN(TRUE);
} }
eatMsg = FALSE;
if ((msg->message == WM_LBUTTONDOWN) || if ((msg->message == WM_LBUTTONDOWN) ||
(msg->message == WM_RBUTTONDOWN) || (msg->message == WM_RBUTTONDOWN) ||
(msg->message == WM_MBUTTONDOWN) || (msg->message == WM_MBUTTONDOWN) ||
@ -1807,8 +1801,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti,
break; break;
} }
} }
CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry);
ListEntry);
} }
while(CurrentEntry != ListHead); while(CurrentEntry != ListHead);

View file

@ -2440,7 +2440,8 @@ PWND FASTCALL
co_WinPosSearchChildren( co_WinPosSearchChildren(
PWND ScopeWin, PWND ScopeWin,
POINT *Point, POINT *Point,
USHORT *HitTest USHORT *HitTest,
BOOL Ignore
) )
{ {
PWND pwndChild; PWND pwndChild;
@ -2451,7 +2452,7 @@ co_WinPosSearchChildren(
return NULL; return NULL;
} }
if ((ScopeWin->style & WS_DISABLED)) if (!Ignore && (ScopeWin->style & WS_DISABLED))
{ {
return NULL; return NULL;
} }
@ -2475,7 +2476,7 @@ co_WinPosSearchChildren(
continue; continue;
} }
pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest); pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest, Ignore);
if(pwndChild != NULL) if(pwndChild != NULL)
{ {
@ -2506,7 +2507,7 @@ co_WinPosSearchChildren(
} }
PWND FASTCALL PWND FASTCALL
co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest) co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore)
{ {
PWND Window; PWND Window;
POINT Point = *WinPoint; POINT Point = *WinPoint;
@ -2524,7 +2525,7 @@ co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest)
ASSERT_REFS_CO(ScopeWin); ASSERT_REFS_CO(ScopeWin);
UserRefObjectCo(ScopeWin, &Ref); UserRefObjectCo(ScopeWin, &Ref);
Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest); Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest, Ignore);
UserDerefObjectCo(ScopeWin); UserDerefObjectCo(ScopeWin);
if (Window) if (Window)
@ -3447,7 +3448,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
UserRefObjectCo(DesktopWindow, &Ref); UserRefObjectCo(DesktopWindow, &Ref);
//pti = PsGetCurrentThreadWin32Thread(); //pti = PsGetCurrentThreadWin32Thread();
Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest); Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest, FALSE);
if (Window) if (Window)
{ {

View file

@ -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_WinPosSetWindowPos(PWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags);
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Window, INT Cmd); BOOLEAN FASTCALL co_WinPosShowWindow(PWND Window, INT Cmd);
void FASTCALL co_WinPosSendSizeMove(PWND Window); 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); VOID FASTCALL co_WinPosActivateOtherWindow(PWND);
PWND FASTCALL IntRealChildWindowFromPoint(PWND,LONG,LONG); PWND FASTCALL IntRealChildWindowFromPoint(PWND,LONG,LONG);
BOOL FASTCALL IntScreenToClient(PWND,LPPOINT); BOOL FASTCALL IntScreenToClient(PWND,LPPOINT);