]> khamidou — GitHub mirrors - electron.git/commitdiff
Hide the fullscreen button when leaving fullscreen mode. Fixes #88.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 11 Sep 2013 05:05:08 +0000 (13:05 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 11 Sep 2013 05:05:08 +0000 (13:05 +0800)
browser/native_window.h
browser/native_window_mac.mm

index 8fb0f118fddf1e93463fc97d068d29662ea6eee3..3316b07053cfd5222af726832130a111804b300b 100644 (file)
@@ -115,6 +115,8 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
     observers_.RemoveObserver(obs);
   }
 
+  bool has_frame() const { return has_frame_; }
+
  protected:
   explicit NativeWindow(content::WebContents* web_contents,
                         base::DictionaryValue* options);
index d6858a191bb08a5a2acf7cf17089289f0429fe68..4994fad65fc2cd905ecfd7669a611f75c5673ce2 100644 (file)
   return NO;
 }
 
+- (void)windowDidExitFullScreen:(NSNotification*)notification {
+  if (!shell_->has_frame()) {
+    NSWindow* window = shell_->GetNativeWindow();
+    [[window standardWindowButton:NSWindowFullScreenButton] setHidden:YES];
+  }
+}
+
 @end
 
 @interface AtomNSWindow : AtomEventProcessingWindow {