emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 b36ba56: Fixed a toolbar related issue on OS X.


From: Anders Lindgren
Subject: [Emacs-diffs] emacs-25 b36ba56: Fixed a toolbar related issue on OS X.
Date: Sun, 15 Nov 2015 18:19:04 +0000

branch: emacs-25
commit b36ba568a98e5bc64895d6f0b1008ca47ab43345
Author: Anders Lindgren <address@hidden>
Commit: Anders Lindgren <address@hidden>

    Fixed a toolbar related issue on OS X.
    
    Earlier, when toggling the tool-bar in a maximized frame, the
    frame size didn't match the number of text lines, leaving an
    unused area at the bottom of the frame.
    
    * nsfns.m (x_set_tool_bar_lines): Exit maximized and full height
    fullscreen modes when tool bar is disabled.
---
 src/nsfns.m |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/nsfns.m b/src/nsfns.m
index c243444..94294de 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -648,6 +648,11 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, 
Lisp_Object oldval)
 void
 x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 {
+  /* Currently, when the tool bar change state, the frame is resized.
+
+     TODO: It would be better if this didn't occur when 1) the frame
+     is full height or maximized or 2) when specified by
+     `frame-inhibit-implied-resize'. */
   int nlines;
 
   if (FRAME_MINIBUF_ONLY_P (f))
@@ -669,7 +674,21 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, 
Lisp_Object oldval)
         {
           free_frame_tool_bar (f);
           FRAME_EXTERNAL_TOOL_BAR (f) = 0;
-        }
+
+          {
+            EmacsView *view = FRAME_NS_VIEW (f);
+            int fs_state = [view fullscreenState];
+
+            if (fs_state == FULLSCREEN_MAXIMIZED)
+              {
+                [view setFSValue:FULLSCREEN_WIDTH];
+              }
+            else if (fs_state == FULLSCREEN_HEIGHT)
+              {
+                [view setFSValue:FULLSCREEN_NONE];
+              }
+          }
+       }
     }
 
   {
@@ -680,8 +699,6 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, 
Lisp_Object oldval)
              || (CONSP (frame_inhibit_implied_resize)
                  && !NILP (Fmemq (Qtool_bar_lines,
                                   frame_inhibit_implied_resize))))
-         /* This will probably fail to DTRT in the
-            fullheight/-width cases.  */
          && NILP (get_frame_param (f, Qfullscreen)))
         ? 0
         : 2);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]