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 8fb0f11..3316b07 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 d6858a1..4994fad 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 {