< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java

Print this page

        

@@ -1244,10 +1244,25 @@
             // No need to order windows if it doesn't own other windows and hence return
             if (windows.length == 0) {
                 return;
             }
 
+            boolean isThereVisibleChild = false;
+
+            // Looking for visible child windows
+            for (int i = 0; i < windows.length; i ++) {
+                if (windows[i].isVisible()) {
+                    isThereVisibleChild = true;
+                    break;
+                }
+            }
+
+            // Do not order the window if all its child are invisible
+            if (!isThereVisibleChild) {
+                return;
+            }
+
             // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
             // the windows are ordered above their nearest owner; ancestors of the window,
             // which is going to become 'main window', are placed above their siblings.
             if (rootOwner.isVisible()) {
                 rootOwner.execute(CWrapper.NSWindow::orderFront);
< prev index next >