Browse Source

fix: properly order out child windows (#29821)

Shelley Vohr 3 years ago
parent
commit
f9bfd1da25
1 changed files with 9 additions and 0 deletions
  1. 9 0
      shell/browser/native_window_mac.mm

+ 9 - 0
shell/browser/native_window_mac.mm

@@ -553,6 +553,15 @@ void NativeWindowMac::Hide() {
     return;
   }
 
+  // Hide all children of the current window before hiding the window.
+  // components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+  // expects this when window visibility changes.
+  if ([window_ childWindows]) {
+    for (NSWindow* child in [window_ childWindows]) {
+      [child orderOut:nil];
+    }
+  }
+
   // Deattach the window from the parent before.
   if (parent())
     InternalSetParentWindow(parent(), false);