From: Cheng Zhao Date: Thu, 7 Jan 2016 07:40:06 +0000 (+0800) Subject: Fix hiding fullscreen button on EL Capitan X-Git-Tag: v0.36.3~8^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=10f663d0178c5a3fa51a5641d00be578b49365af;p=electron.git Fix hiding fullscreen button on EL Capitan --- diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 45123d24..3735772f 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -469,12 +469,17 @@ NativeWindowMac::NativeWindowMac( [window_ setDisableAutoHideCursor:disableAutoHideCursor]; // Disable fullscreen button when 'fullscreen' is specified to false. - bool fullscreen; + bool fullscreen = false; if (!(options.Get(options::kFullscreen, &fullscreen) && !fullscreen)) { NSUInteger collectionBehavior = [window_ collectionBehavior]; collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; [window_ setCollectionBehavior:collectionBehavior]; + } else if (base::mac::IsOSElCapitanOrLater()) { + // On EL Capitan this flag is required to hide fullscreen button. + NSUInteger collectionBehavior = [window_ collectionBehavior]; + collectionBehavior |= NSWindowCollectionBehaviorFullScreenAuxiliary; + [window_ setCollectionBehavior:collectionBehavior]; } NSView* view = inspectable_web_contents()->GetView()->GetNativeView();