--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp Wed Nov 23 14:28:14 2016 +0530
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp Wed Nov 23 18:48:02 2016 +0300
@@ -484,7 +484,10 @@
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