8140525: AwtFrame::WmShowWindow() may steal focus

Reviewed-by: serb, ssadetsky
This commit is contained in:
Anton Tarasov 2016-11-23 18:48:02 +03:00
parent ba274b43ec
commit 9d87230fcc

View File

@ -484,7 +484,10 @@ MsgRouting AwtFrame::WmShowWindow(BOOL show, UINT status)
if (fgProcessID != ::GetCurrentProcessId()) {
AwtWindow* window = (AwtWindow*)GetComponent(GetHWnd());
if (window != NULL && window->IsFocusableWindow() && window->IsAutoRequestFocus() &&
if (window != NULL &&
window->IsFocusableWindow() &&
window->IsAutoRequestFocus() &&
!::IsWindowVisible(GetHWnd()) && // the window is really showing
!::IsWindow(GetModalBlocker(GetHWnd())))
{
// When the Java process is not allowed to set the foreground window