aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2014-04-04 18:32:24 +0200
committerJan Djärv2014-04-04 18:32:24 +0200
commit11a9c72fafaa02ef26708da6ffe765a7fdaa4565 (patch)
treee20e6c51747a69be7e81daa1ab1be642a7981043
parent97bac2112e7b4332834900863810370a57e38fbe (diff)
downloademacs-11a9c72fafaa02ef26708da6ffe765a7fdaa4565.tar.gz
emacs-11a9c72fafaa02ef26708da6ffe765a7fdaa4565.zip
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.
-rw-r--r--src/ChangeLog13
-rw-r--r--src/nsmenu.m15
-rw-r--r--src/nsterm.h1
-rw-r--r--src/nsterm.m14
4 files changed, 39 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c35206447f1..c370bdc0404 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
12014-04-04 Jan Djärv <jan.h.d@swipnet.se>
2
3 Backport from trunk.
4 * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool
5 bar is zero height, just return (Bug#16976).
6 (initFrameFromEmacs:): Initialize wait_for_tool_bar.
7
8 * nsterm.h (EmacsView): Add wait_for_tool_bar.
9
10 * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
11 is nil. If waiting for toolbar to complete, force a redraw.
12 (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976)
13
12014-04-03 Ken Brown <kbrown@cornell.edu> 142014-04-03 Ken Brown <kbrown@cornell.edu>
2 15
3 * Makefile.in (EMACS_MANIFEST): Update comment. (Bug#17176) 16 * Makefile.in (EMACS_MANIFEST): Update comment. (Bug#17176)
diff --git a/src/nsmenu.m b/src/nsmenu.m
index f8cd07478ed..24842241f37 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1054,8 +1054,10 @@ free_frame_tool_bar (struct frame *f)
1054 Under NS we just hide the toolbar until it might be needed again. 1054 Under NS we just hide the toolbar until it might be needed again.
1055 -------------------------------------------------------------------------- */ 1055 -------------------------------------------------------------------------- */
1056{ 1056{
1057 EmacsView *view = FRAME_NS_VIEW (f);
1057 block_input (); 1058 block_input ();
1058 [[FRAME_NS_VIEW (f) toolbar] setVisible: NO]; 1059 view->wait_for_tool_bar = NO;
1060 [[view toolbar] setVisible: NO];
1059 FRAME_TOOLBAR_HEIGHT (f) = 0; 1061 FRAME_TOOLBAR_HEIGHT (f) = 0;
1060 unblock_input (); 1062 unblock_input ();
1061} 1063}
@@ -1071,6 +1073,7 @@ update_frame_tool_bar (struct frame *f)
1071 NSWindow *window = [view window]; 1073 NSWindow *window = [view window];
1072 EmacsToolbar *toolbar = [view toolbar]; 1074 EmacsToolbar *toolbar = [view toolbar];
1073 1075
1076 if (view == nil || toolbar == nil) return;
1074 block_input (); 1077 block_input ();
1075 1078
1076#ifdef NS_IMPL_COCOA 1079#ifdef NS_IMPL_COCOA
@@ -1176,9 +1179,13 @@ update_frame_tool_bar (struct frame *f)
1176 FRAME_TOOLBAR_HEIGHT (f) = 1179 FRAME_TOOLBAR_HEIGHT (f) =
1177 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) 1180 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
1178 - FRAME_NS_TITLEBAR_HEIGHT (f); 1181 - FRAME_NS_TITLEBAR_HEIGHT (f);
1179 if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen. 1182 if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
1180 FRAME_TOOLBAR_HEIGHT (f) = 0; 1183 FRAME_TOOLBAR_HEIGHT (f) = 0;
1181 unblock_input (); 1184
1185 if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0)
1186 [view setNeedsDisplay: YES];
1187
1188 unblock_input ();
1182} 1189}
1183 1190
1184 1191
diff --git a/src/nsterm.h b/src/nsterm.h
index 8e8a9b7f36f..74789634a90 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -162,6 +162,7 @@ typedef float EmacsCGFloat;
162 int scrollbarsNeedingUpdate; 162 int scrollbarsNeedingUpdate;
163 EmacsToolbar *toolbar; 163 EmacsToolbar *toolbar;
164 NSRect ns_userRect; 164 NSRect ns_userRect;
165 BOOL wait_for_tool_bar;
165 } 166 }
166 167
167/* AppKit-side interface */ 168/* AppKit-side interface */
diff --git a/src/nsterm.m b/src/nsterm.m
index 0e8fc56fdd9..c7cb4faa3b7 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5766,6 +5766,13 @@ not_in_argv (NSString *arg)
5766 + FRAME_TOOLBAR_HEIGHT (emacsframe); 5766 + FRAME_TOOLBAR_HEIGHT (emacsframe);
5767 } 5767 }
5768 5768
5769 if (wait_for_tool_bar)
5770 {
5771 if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0)
5772 return;
5773 wait_for_tool_bar = NO;
5774 }
5775
5769 neww = (int)wr.size.width - emacsframe->border_width; 5776 neww = (int)wr.size.width - emacsframe->border_width;
5770 newh = (int)wr.size.height - extra; 5777 newh = (int)wr.size.height - extra;
5771 5778
@@ -6078,6 +6085,13 @@ if (cols > 0 && rows > 0)
6078 ns_window_num]]; 6085 ns_window_num]];
6079 [win setToolbar: toolbar]; 6086 [win setToolbar: toolbar];
6080 [toolbar setVisible: NO]; 6087 [toolbar setVisible: NO];
6088
6089 /* Don't set frame garbaged until tool bar is up to date?
6090 This avoids an extra clear and redraw (flicker) at frame creation. */
6091 if (FRAME_EXTERNAL_TOOL_BAR (f)) wait_for_tool_bar = YES;
6092 else wait_for_tool_bar = NO;
6093
6094
6081#ifdef NS_IMPL_COCOA 6095#ifdef NS_IMPL_COCOA
6082 { 6096 {
6083 NSButton *toggleButton; 6097 NSButton *toggleButton;