]> git.eshelyaron.com Git - emacs.git/commitdiff
* nsterm.m (ns_update_begin): If native fullscreen and no toolbar,
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 6 Oct 2013 15:53:30 +0000 (17:53 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 6 Oct 2013 15:53:30 +0000 (17:53 +0200)
hide toolbar.
(windowDidEnterFullScreen:): If presentation options are zero,
set them here (Bug#15388).

src/ChangeLog
src/nsterm.m

index 83ef0f559069643f3bf36d42d7155d3195d9d4fc..af5dbb8924d3e151d1673775921329cabefe02a7 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-06  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (ns_update_begin): If native fullscreen and no toolbar,
+       hide toolbar (Bug#15388).
+       (windowDidEnterFullScreen:): If presentation options are zero,
+       set them here (Bug#15388).
+
 2013-10-05  Xue Fuqiao  <xfq.free@gmail.com>
 
        * editfns.c (message): Mention batch mode in doc string.
index 4a486aa4018a063e80f4a4c9001c86a30ac791ed..be660d99e8ae86afc2797a16bde7a9682684cc98 100644 (file)
@@ -673,11 +673,22 @@ ns_update_begin (struct frame *f)
    external (RIF) call; whole frame, called before update_window_begin
    -------------------------------------------------------------------------- */
 {
-  NSView *view = FRAME_NS_VIEW (f);
+  EmacsView *view = FRAME_NS_VIEW (f);
   NSTRACE (ns_update_begin);
 
   ns_update_auto_hide_menu_bar ();
 
+#ifdef NS_IMPL_COCOA
+  if ([view isFullscreen] && [view fsIsNative])
+  {
+    // Fix reappearing tool bar in fullscreen for OSX 10.7
+    BOOL tbar_visible = FRAME_EXTERNAL_TOOL_BAR (f) ? YES : NO;
+    NSToolbar *toolbar = [FRAME_NS_VIEW (f) toolbar];
+    if (! tbar_visible != ! [toolbar isVisible])
+      [toolbar setVisible: tbar_visible];
+  }
+#endif
+
   ns_updating_frame = f;
   [view lockFocus];
 
@@ -6115,8 +6126,27 @@ if (cols > 0 && rows > 0)
       [self windowDidBecomeKey:notification];
       [nonfs_window orderOut:self];
     }
-  else if (! FRAME_EXTERNAL_TOOL_BAR (emacsframe))
-    [toolbar setVisible:NO];
+  else
+    {
+      BOOL tbar_visible = FRAME_EXTERNAL_TOOL_BAR (emacsframe) ? YES : NO;
+#ifdef NS_IMPL_COCOA
+      unsigned val = (unsigned)[NSApp presentationOptions];
+
+      // OSX 10.7 bug fix, the menu won't appear without this.
+      // val is non-zero on other OSX versions.
+      if (val == 0)
+        {
+          NSApplicationPresentationOptions options
+            = NSApplicationPresentationAutoHideDock
+            | NSApplicationPresentationAutoHideMenuBar
+            | NSApplicationPresentationFullScreen
+            | NSApplicationPresentationAutoHideToolbar;
+
+          [NSApp setPresentationOptions: options];
+        }
+#endif
+      [toolbar setVisible:tbar_visible];
+    }
 }
 
 - (void)windowWillExitFullScreen:(NSNotification *)notification