From f9bfd1da2522bcdc2cff43065ea90666e3693dd0 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 24 Jun 2021 20:43:28 +0200 Subject: [PATCH] fix: properly order out child windows (#29821) --- shell/browser/native_window_mac.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index c13121c5aa58..b7473b1f2ead 100644 --- a/shell/browser/native_window_mac.mm +++ b/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);