emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r116907: Backport from trunk.


From: Jan D.
Subject: [Emacs-diffs] emacs-24 r116907: Backport from trunk.
Date: Fri, 04 Apr 2014 16:33:14 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116907
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16976
committer: Jan D. <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-04-04 18:32:24 +0200
message:
         Backport from trunk.
         * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
  is nil.  If waiting for toolbar to complete, force a redraw.
  (free_frame_tool_bar): Set wait_for_tool_bar = NO
  
         * nsterm.h (EmacsView): Add wait_for_tool_bar.
  
  * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool
         bar is zero height, just return (Bug#16976).
         (initFrameFromEmacs:): Initialize wait_for_tool_bar.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsmenu.m                   nsmenu.m-20091113204419-o5vbwnq5f7feedwu-8744
  src/nsterm.h                   nsterm.h-20091113204419-o5vbwnq5f7feedwu-8746
  src/nsterm.m                   nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-04-03 19:10:35 +0000
+++ b/src/ChangeLog     2014-04-04 16:32:24 +0000
@@ -1,3 +1,16 @@
+2014-04-04  Jan Djärv  <address@hidden>
+
+       Backport from trunk.
+       * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool
+       bar is zero height, just return (Bug#16976).
+       (initFrameFromEmacs:): Initialize wait_for_tool_bar.
+
+       * nsterm.h (EmacsView): Add wait_for_tool_bar.
+
+       * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
+       is nil.  If waiting for toolbar to complete, force a redraw.
+       (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976)
+
 2014-04-03  Ken Brown  <address@hidden>
 
        * Makefile.in (EMACS_MANIFEST): Update comment.  (Bug#17176)

=== modified file 'src/nsmenu.m'
--- a/src/nsmenu.m      2014-01-20 19:44:56 +0000
+++ b/src/nsmenu.m      2014-04-04 16:32:24 +0000
@@ -1054,8 +1054,10 @@
     Under NS we just hide the toolbar until it might be needed again.
    -------------------------------------------------------------------------- 
*/
 {
+  EmacsView *view = FRAME_NS_VIEW (f);
   block_input ();
-  [[FRAME_NS_VIEW (f) toolbar] setVisible: NO];
+  view->wait_for_tool_bar = NO;
+  [[view toolbar] setVisible: NO];
   FRAME_TOOLBAR_HEIGHT (f) = 0;
   unblock_input ();
 }
@@ -1071,6 +1073,7 @@
   NSWindow *window = [view window];
   EmacsToolbar *toolbar = [view toolbar];
 
+  if (view == nil || toolbar == nil) return;
   block_input ();
 
 #ifdef NS_IMPL_COCOA
@@ -1176,9 +1179,13 @@
   FRAME_TOOLBAR_HEIGHT (f) =
     NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
     - FRAME_NS_TITLEBAR_HEIGHT (f);
-    if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
-      FRAME_TOOLBAR_HEIGHT (f) = 0;
-    unblock_input ();
+  if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
+    FRAME_TOOLBAR_HEIGHT (f) = 0;
+
+  if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0)
+      [view setNeedsDisplay: YES];
+
+  unblock_input ();
 }
 
 

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2014-03-08 15:49:59 +0000
+++ b/src/nsterm.h      2014-04-04 16:32:24 +0000
@@ -162,6 +162,7 @@
    int scrollbarsNeedingUpdate;
    EmacsToolbar *toolbar;
    NSRect ns_userRect;
+   BOOL wait_for_tool_bar;
    }
 
 /* AppKit-side interface */

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2014-03-08 15:49:59 +0000
+++ b/src/nsterm.m      2014-04-04 16:32:24 +0000
@@ -5766,6 +5766,13 @@
         + FRAME_TOOLBAR_HEIGHT (emacsframe);
     }
 
+  if (wait_for_tool_bar)
+    {
+      if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0)
+        return;
+      wait_for_tool_bar = NO;
+    }
+
   neww = (int)wr.size.width - emacsframe->border_width;
   newh = (int)wr.size.height - extra;
 
@@ -6078,6 +6085,13 @@
                                    ns_window_num]];
   [win setToolbar: toolbar];
   [toolbar setVisible: NO];
+
+  /* Don't set frame garbaged until tool bar is up to date?
+     This avoids an extra clear and redraw (flicker) at frame creation.  */
+  if (FRAME_EXTERNAL_TOOL_BAR (f)) wait_for_tool_bar = YES;
+  else wait_for_tool_bar = NO;
+
+
 #ifdef NS_IMPL_COCOA
   {
     NSButton *toggleButton;


reply via email to

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