From d0c91daaeda67ceb3f0bdab534ec66fd99e3ac95 Mon Sep 17 00:00:00 2001 From: xaviergonz Date: Mon, 1 May 2017 22:21:05 +0200 Subject: [PATCH] make sure setparentwindow only shows the window if already visible --- atom/browser/native_window_mac.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 73a20ea62ad1..cfa4dc91e35c 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -914,8 +914,7 @@ NativeWindowMac::NativeWindowMac( // Only use native parent window for non-modal windows. if (parent && !is_modal()) { - // It will be properly attached on show and detached on hide. - InternalSetParentWindow(parent, false); + SetParentWindow(parent); } if (transparent()) { @@ -1566,7 +1565,7 @@ void NativeWindowMac::InternalSetParentWindow(NativeWindow* parent, bool attach) } void NativeWindowMac::SetParentWindow(NativeWindow* parent) { - InternalSetParentWindow(parent, true); + InternalSetParentWindow(parent, IsVisible()); } gfx::NativeView NativeWindowMac::GetNativeView() const {