< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp

Print this page

        

@@ -482,11 +482,14 @@
             ::GetWindowThreadProcessId(fgHWnd, &fgProcessID);
 
             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
                     // (see MSDN) the request below will just have no effect.
                     ::SetForegroundWindow(GetHWnd());
< prev index next >