diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 5597a8c996cfb..0e9f310417975 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -706,6 +706,15 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { 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);