+2014-03-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * 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.
+
2014-03-28 Glenn Morris <rgm@gnu.org>
* emacs.c (emacs_version): Use PACKAGE_VERSION rather than VERSION.
NSWindow *window = [view window];
EmacsToolbar *toolbar = [view toolbar];
+ if (view == nil || toolbar == nil) return;
block_input ();
#ifdef NS_IMPL_COCOA
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 ();
}
int scrollbarsNeedingUpdate;
EmacsToolbar *toolbar;
NSRect ns_userRect;
+ BOOL wait_for_tool_bar;
}
/* AppKit-side interface */
+ 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;
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;