From fe0ec3d86519f48d60491559120d6b72cb6faf8f Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 20 Aug 2012 03:59:24 +0000 Subject: [PATCH] [NtUser] - Fix API SetActiveWindow test, get it back. svn path=/trunk/; revision=57113 --- reactos/win32ss/user/ntuser/focus.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/reactos/win32ss/user/ntuser/focus.c b/reactos/win32ss/user/ntuser/focus.c index 5a5ab0401f5..444c83aeacf 100644 --- a/reactos/win32ss/user/ntuser/focus.c +++ b/reactos/win32ss/user/ntuser/focus.c @@ -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); + } } }