[NtUser]
authorJames Tabor <james.tabor@reactos.org>
Mon, 20 Aug 2012 03:59:24 +0000 (03:59 +0000)
committerJames Tabor <james.tabor@reactos.org>
Mon, 20 Aug 2012 03:59:24 +0000 (03:59 +0000)
- Fix API SetActiveWindow test, get it back.

svn path=/trunk/; revision=57113

reactos/win32ss/user/ntuser/focus.c

index 5a5ab04..444c83a 100644 (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);
+         }
       }
    }