user32: Try to activate topmost activable window in WINPOS_ActivateOtherWindow.

This commit is contained in:
Piotr Caban 2014-05-28 12:57:47 +02:00 committed by Alexandre Julliard
parent c318cda8d1
commit 7257b62bd1
2 changed files with 18 additions and 1 deletions

View File

@ -3766,6 +3766,11 @@ static void test_SetParent(void)
ok(bret, "SetForegroundWindow() failed\n"); ok(bret, "SetForegroundWindow() failed\n");
check_active_state(popup, popup, popup); 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(DestroyWindow(parent), "DestroyWindow() failed\n");
ok(!IsWindow(parent), "parent still exists\n"); ok(!IsWindow(parent), "parent still exists\n");

View File

@ -1536,7 +1536,19 @@ void WINPOS_ActivateOtherWindow(HWND hwnd)
for (;;) for (;;)
{ {
if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break; 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: done: