mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 08:25:53 +00:00
[Win32k]
- Do not re-enter SetFocus, just call message handling to switch focus window. - Fix broken logic when searching for a non child ancestor to send messages/Set focus to. - See CORE-6452. svn path=/trunk/; revision=62196
This commit is contained in:
parent
32351ba6e9
commit
ae68a510d4
|
@ -734,14 +734,13 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL, BOOL bMouse, BOOL bFocus, BOOL Async)
|
||||||
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 */
|
||||||
if (ThreadQueue->spwndActive == Wnd)
|
if (pti->MessageQueue->spwndActive != IntGetNonChildAncestor(pti->MessageQueue->spwndFocus))
|
||||||
{
|
{
|
||||||
if (!ThreadQueue->spwndFocus ||
|
PWND pWndSend = pti->MessageQueue->spwndActive;
|
||||||
!Wnd ||
|
// Clear focus if the active window is minimized.
|
||||||
UserGetAncestor(ThreadQueue->spwndFocus, GA_ROOT) != Wnd)
|
if (pWndSend && pti->MessageQueue->spwndActive->style & WS_MINIMIZE) pWndSend = NULL;
|
||||||
{
|
// Send focus messages and if so, set the focus.
|
||||||
co_UserSetFocus(Wnd);
|
IntSendFocusMessages( pti, pWndSend);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,12 +814,13 @@ co_UserSetFocus(PWND Window)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we can set the focus to this window */
|
/* Check if we can set the focus to this window */
|
||||||
for (pwndTop = Window; pwndTop != NULL; pwndTop = pwndTop->spwndParent)
|
//// Fixes wine win test_SetParent both "todo" line 3710 and 3720...
|
||||||
|
for (pwndTop = Window; pwndTop; pwndTop = pwndTop->spwndParent)
|
||||||
{
|
{
|
||||||
if (pwndTop->style & (WS_MINIMIZED|WS_DISABLED)) return 0;
|
if (pwndTop->style & (WS_MINIMIZED|WS_DISABLED)) return 0;
|
||||||
if ((pwndTop->style & (WS_POPUP|WS_CHILD)) != WS_CHILD) break;
|
if ((pwndTop->style & (WS_POPUP|WS_CHILD)) != WS_CHILD) break;
|
||||||
}
|
}
|
||||||
|
////
|
||||||
if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev))
|
if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev))
|
||||||
{
|
{
|
||||||
ERR("SetFocus 1 WH_CBT Call Hook return!\n");
|
ERR("SetFocus 1 WH_CBT Call Hook return!\n");
|
||||||
|
|
|
@ -1565,10 +1565,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT
|
||||||
if (pwndMsg != MessageQueue->spwndActive)
|
if (pwndMsg != MessageQueue->spwndActive)
|
||||||
{
|
{
|
||||||
PWND pwndTop = pwndMsg;
|
PWND pwndTop = pwndMsg;
|
||||||
while (pwndTop && ((pwndTop->style & (WS_POPUP|WS_CHILD)) == WS_CHILD))
|
pwndTop = IntGetNonChildAncestor(pwndTop);
|
||||||
{
|
|
||||||
pwndTop = pwndTop->spwndParent;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pwndTop && pwndTop != pwndDesktop)
|
if (pwndTop && pwndTop != pwndDesktop)
|
||||||
{
|
{
|
||||||
|
|
|
@ -277,11 +277,8 @@ IntWinListChildren(PWND Window)
|
||||||
PWND FASTCALL
|
PWND FASTCALL
|
||||||
IntGetNonChildAncestor(PWND pWnd)
|
IntGetNonChildAncestor(PWND pWnd)
|
||||||
{
|
{
|
||||||
if (pWnd)
|
while(pWnd && (pWnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
|
||||||
{
|
pWnd = pWnd->spwndParent;
|
||||||
while(pWnd && ((pWnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
|
|
||||||
pWnd = pWnd->spwndParent;
|
|
||||||
}
|
|
||||||
return pWnd;
|
return pWnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue