mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Yet another fix to WinPosActivateOtherWindow, we should search only for top-level windows next to the window we're about to deactivate.
svn path=/trunk/; revision=16751
This commit is contained in:
parent
b165c36180
commit
dfaa3196ee
1 changed files with 15 additions and 41 deletions
|
@ -114,6 +114,8 @@ WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
|
|||
IntSetFocusMessageQueue(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If this is popup window, try to activate the owner first. */
|
||||
if ((Window->Style & WS_POPUP) && (Wnd = IntGetOwner(Window)))
|
||||
{
|
||||
for(;;)
|
||||
|
@ -135,50 +137,21 @@ WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
|
|||
|
||||
IntReleaseWindowObject(Wnd);
|
||||
}
|
||||
|
||||
/* Pick a next top-level window. */
|
||||
/* FIXME: Search for non-tooltip windows first. */
|
||||
Wnd = Window;
|
||||
for(;;)
|
||||
while (Wnd != NULL)
|
||||
{
|
||||
HWND *List, *phWnd;
|
||||
|
||||
Old = Wnd;
|
||||
Wnd = IntGetParentObject(Wnd);
|
||||
if(Old != Window)
|
||||
{
|
||||
IntLockRelatives(Old);
|
||||
Wnd = IntGetWindowObject(Old->NextSibling->Self);
|
||||
IntUnLockRelatives(Old);
|
||||
if (Old != Window)
|
||||
IntReleaseWindowObject(Old);
|
||||
}
|
||||
if(!Wnd)
|
||||
{
|
||||
IntSetFocusMessageQueue(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if((List = IntWinListChildren(Wnd)))
|
||||
{
|
||||
/* FIXME: We should scan for non-tooltip windows first. */
|
||||
for(phWnd = List; *phWnd; phWnd++)
|
||||
{
|
||||
PWINDOW_OBJECT Child;
|
||||
|
||||
if((*phWnd) == Window->Self)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if((Child = IntGetWindowObject(*phWnd)))
|
||||
{
|
||||
if ((Child->Style & (WS_DISABLED | WS_VISIBLE)) == WS_VISIBLE &&
|
||||
(Child->Style & (WS_POPUP | WS_CHILD)) != WS_CHILD)
|
||||
{
|
||||
ExFreePool(List);
|
||||
IntReleaseWindowObject(Wnd);
|
||||
Wnd = Child;
|
||||
goto done;
|
||||
}
|
||||
IntReleaseWindowObject(Child);
|
||||
}
|
||||
}
|
||||
ExFreePool(List);
|
||||
}
|
||||
if ((Wnd->Style & (WS_DISABLED | WS_VISIBLE)) == WS_VISIBLE &&
|
||||
(Wnd->Style & (WS_POPUP | WS_CHILD)) != WS_CHILD)
|
||||
break;
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -193,6 +166,7 @@ done:
|
|||
}
|
||||
if (!IntSetActiveWindow(Wnd))
|
||||
IntSetActiveWindow(0);
|
||||
if (Wnd)
|
||||
IntReleaseWindowObject(Wnd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue