Fix hiding fullscreen button on EL Capitan
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Jan 2016 07:40:06 +0000 (15:40 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Jan 2016 07:46:40 +0000 (15:46 +0800)
atom/browser/native_window_mac.mm

index 45123d2..3735772 100644 (file)
@@ -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();