Piotr Caban : user32: Try to activate topmost activable window in WINPOS_ActivateOtherWindow.

Alexandre Julliard julliard at winehq.org
Wed Jun 11 13:36:22 CDT 2014


Module: wine
Branch: master
Commit: 7257b62bd1b95438c651716b48bf3d7438eb235a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7257b62bd1b95438c651716b48bf3d7438eb235a

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed May 28 12:57:47 2014 +0200

user32: Try to activate topmost activable window in WINPOS_ActivateOtherWindow.

---

 dlls/user32/tests/win.c |    5 +++++
 dlls/user32/winpos.c    |   14 +++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index cffceb3..cbcd6b6 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3766,6 +3766,11 @@ static void test_SetParent(void)
     ok(bret, "SetForegroundWindow() failed\n");
     check_active_state(popup, popup, popup);
 
+    ShowWindow(parent, SW_SHOW);
+    SetActiveWindow(popup);
+    ok(DestroyWindow(popup), "DestroyWindow() failed\n");
+    check_active_state(parent, parent, parent);
+
     ok(DestroyWindow(parent), "DestroyWindow() failed\n");
 
     ok(!IsWindow(parent), "parent still exists\n");
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 57fefe3..0a70942 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1536,7 +1536,19 @@ void WINPOS_ActivateOtherWindow(HWND hwnd)
     for (;;)
     {
         if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break;
-        if (can_activate_window( hwndTo )) break;
+        if (can_activate_window( hwndTo )) goto done;
+    }
+
+    hwndTo = GetTopWindow( 0 );
+    for (;;)
+    {
+        if (hwndTo == hwnd)
+        {
+            hwndTo = 0;
+            break;
+        }
+        if (can_activate_window( hwndTo )) goto done;
+        if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break;
     }
 
  done:




More information about the wine-cvs mailing list