- Fix API SetActiveWindow test, get it back.

svn path=/trunk/; revision=57113
This commit is contained in:
James Tabor 2012-08-20 03:59:24 +00:00
parent 06b23a2294
commit fe0ec3d865

View file

@ -591,13 +591,14 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL, HWND * Prev, BOOL bMouse, BOOL bFocus,
if (bFocus && !(ThreadQueue->QF_flags & QF_FOCUSNULLSINCEACTIVE))
{
/* Do not change focus if the window is no longer active */
if ( !Wnd || IntGetNonChildAncestor(ThreadQueue->spwndFocus) != ThreadQueue->spwndActive)
if (ThreadQueue->spwndActive == Wnd)
{
PWND pWndTemp = Wnd;
if (ThreadQueue->spwndActive && ThreadQueue->spwndActive->style & WS_MINIMIZE)
pWndTemp = NULL;
TRACE("SAW is setting Focus! 0x%p Temp 0x%p\n",Wnd, pWndTemp);
IntSendFocusMessages(pti, pWndTemp);
if (!ThreadQueue->spwndFocus ||
!Wnd ||
UserGetAncestor(ThreadQueue->spwndFocus, GA_ROOT) != Wnd)
{
co_UserSetFocus(Wnd);
}
}
}