[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116907: Avoid flickering on frame creation with too
From: |
Jan D. |
Subject: |
[Emacs-diffs] trunk r116907: Avoid flickering on frame creation with tool bar on OSX. |
Date: |
Sun, 30 Mar 2014 17:21:26 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116907
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16976
committer: Jan Djärv <address@hidden>
branch nick: trunk
timestamp: Sun 2014-03-30 19:21:20 +0200
message:
Avoid flickering on frame creation with tool bar on OSX.
* nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
is nil. If waiting for toolbar to complete, force a redraw.
* 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.
(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-03-28 23:11:39 +0000
+++ b/src/ChangeLog 2014-03-30 17:21:20 +0000
@@ -1,3 +1,14 @@
+2014-03-30 Jan Djärv <address@hidden>
+
+ * 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 <address@hidden>
* emacs.c (emacs_version): Use PACKAGE_VERSION rather than VERSION.
=== modified file 'src/nsmenu.m'
--- a/src/nsmenu.m 2014-01-20 19:44:56 +0000
+++ b/src/nsmenu.m 2014-03-30 17:21:20 +0000
@@ -1071,6 +1071,7 @@
NSWindow *window = [view window];
EmacsToolbar *toolbar = [view toolbar];
+ if (view == nil || toolbar == nil) return;
block_input ();
#ifdef NS_IMPL_COCOA
@@ -1176,9 +1177,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-03-30 17:21:20 +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-03-30 17:21:20 +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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116907: Avoid flickering on frame creation with tool bar on OSX.,
Jan D. <=