Do not change focus if the being activated window is no longer

active.
This commit is contained in:
Dmitry Timoshkov 2005-11-15 16:53:26 +00:00 committed by Alexandre Julliard
parent f81694cc0c
commit 0f7ef4bd8d
1 changed files with 9 additions and 3 deletions

View File

@ -161,9 +161,15 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
/* now change focus if necessary */
if (focus)
{
HWND curfocus = GetFocus();
if (!curfocus || !hwnd || GetAncestor( curfocus, GA_ROOT ) != hwnd)
set_focus_window( hwnd );
GUITHREADINFO info;
GetGUIThreadInfo( GetCurrentThreadId(), &info );
/* Do not change focus if the window is no more active */
if (hwnd == info.hwndActive)
{
if (!info.hwndFocus || !hwnd || GetAncestor( info.hwndFocus, GA_ROOT ) != hwnd)
set_focus_window( hwnd );
}
}
return TRUE;