aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorAnders Lindgren2015-10-28 12:06:39 +0100
committerAnders Lindgren2015-10-28 12:06:39 +0100
commit590449f3d87f8f43eb0a852233e8945ecbe1c6aa (patch)
tree7c3c96ae80d72318be524f475ea7a84e98870166 /src/nsterm.m
parent934bfb933f4981b2edaa208186e2f8781ab6cb9f (diff)
downloademacs-590449f3d87f8f43eb0a852233e8945ecbe1c6aa.tar.gz
emacs-590449f3d87f8f43eb0a852233e8945ecbe1c6aa.zip
Fix incorrect NextStep tool-bar-mode -- wrong number of rows in frame.
* nsterm.h (struct ns_output): New flag, in_animation. * nsfns.m (Fx_create_frame): Initialize in_animation flag. * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Set in_animation flag around call to "setVisible". Set new tool bar height before call to setVisible. * nsterm.m (x_set_window_size): Don't call [view setRow: andColumns:] as this fools the subsequent call to updateFrameSize from performing the real resize. (windowDidResize): Don't update anything when in_animation is non-zero. Trace output. * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar) (EmacsToolbar): * nsterm.m (x_set_window_size, updateFrameSize) ([EmacsView setRows: andColumns:])
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index e5eb8caaef3..ba205f53f4b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1497,7 +1497,7 @@ x_set_window_size (struct frame *f,
1497 if (view == nil) 1497 if (view == nil)
1498 return; 1498 return;
1499 1499
1500 NSTRACE_RECT ("input", wr); 1500 NSTRACE_RECT ("current", wr);
1501 1501
1502/*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/ 1502/*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/
1503 1503
@@ -1559,7 +1559,6 @@ x_set_window_size (struct frame *f,
1559 make_number (FRAME_NS_TITLEBAR_HEIGHT (f)), 1559 make_number (FRAME_NS_TITLEBAR_HEIGHT (f)),
1560 make_number (FRAME_TOOLBAR_HEIGHT (f)))); 1560 make_number (FRAME_TOOLBAR_HEIGHT (f))));
1561 1561
1562 [view setRows: rows andColumns: cols];
1563 NSTRACE_RECT ("setFrame", wr); 1562 NSTRACE_RECT ("setFrame", wr);
1564 [window setFrame: wr display: YES]; 1563 [window setFrame: wr display: YES];
1565 1564
@@ -6142,6 +6141,8 @@ not_in_argv (NSString *arg)
6142 NSTRACE ("updateFrameSize"); 6141 NSTRACE ("updateFrameSize");
6143 NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); 6142 NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
6144 NSTRACE_RECT ("Original frame", wr); 6143 NSTRACE_RECT ("Original frame", wr);
6144 NSTRACE_MSG ("Original columns: %d", cols);
6145 NSTRACE_MSG ("Original rows: %d", rows);
6145 6146
6146 if (! [self isFullscreen]) 6147 if (! [self isFullscreen])
6147 { 6148 {
@@ -6158,13 +6159,19 @@ not_in_argv (NSString *arg)
6158 if (wait_for_tool_bar) 6159 if (wait_for_tool_bar)
6159 { 6160 {
6160 if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0) 6161 if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0)
6161 return; 6162 {
6163 NSTRACE_MSG ("Waiting for toolbar");
6164 return;
6165 }
6162 wait_for_tool_bar = NO; 6166 wait_for_tool_bar = NO;
6163 } 6167 }
6164 6168
6165 neww = (int)wr.size.width - emacsframe->border_width; 6169 neww = (int)wr.size.width - emacsframe->border_width;
6166 newh = (int)wr.size.height - extra; 6170 newh = (int)wr.size.height - extra;
6167 6171
6172 NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
6173 NSTRACE_MSG ("tool_bar_height: %d", emacsframe->tool_bar_height);
6174
6168 cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww); 6175 cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww);
6169 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh); 6176 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh);
6170 6177
@@ -6174,6 +6181,9 @@ not_in_argv (NSString *arg)
6174 if (rows < MINHEIGHT) 6181 if (rows < MINHEIGHT)
6175 rows = MINHEIGHT; 6182 rows = MINHEIGHT;
6176 6183
6184 NSTRACE_MSG ("New columns: %d", cols);
6185 NSTRACE_MSG ("New rows: %d", rows);
6186
6177 if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) 6187 if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
6178 { 6188 {
6179 NSView *view = FRAME_NS_VIEW (emacsframe); 6189 NSView *view = FRAME_NS_VIEW (emacsframe);
@@ -6191,6 +6201,10 @@ not_in_argv (NSString *arg)
6191 [view setFrame: wr]; 6201 [view setFrame: wr];
6192 [self windowDidMove:nil]; // Update top/left. 6202 [self windowDidMove:nil]; // Update top/left.
6193 } 6203 }
6204 else
6205 {
6206 NSTRACE_MSG ("No change");
6207 }
6194} 6208}
6195 6209
6196- (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize 6210- (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
@@ -6299,6 +6313,12 @@ not_in_argv (NSString *arg)
6299{ 6313{
6300 NSTRACE ("windowDidResize"); 6314 NSTRACE ("windowDidResize");
6301 6315
6316 if (emacsframe->output_data.ns->in_animation)
6317 {
6318 NSTRACE_MSG ("Ignored (in animation)");
6319 return;
6320 }
6321
6302 if (! [self fsIsNative]) 6322 if (! [self fsIsNative])
6303 { 6323 {
6304 NSWindow *theWindow = [notification object]; 6324 NSWindow *theWindow = [notification object];
@@ -7396,6 +7416,7 @@ not_in_argv (NSString *arg)
7396 7416
7397- (void) setRows: (int) r andColumns: (int) c 7417- (void) setRows: (int) r andColumns: (int) c
7398{ 7418{
7419 NSTRACE ("[EmacsView setRows:%d andColumns:%d]", r, c);
7399 rows = r; 7420 rows = r;
7400 cols = c; 7421 cols = c;
7401} 7422}