aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdrian Robert2009-03-06 14:53:02 +0000
committerAdrian Robert2009-03-06 14:53:02 +0000
commit4ddf94bd81d39f0db81d1e387aee608492862632 (patch)
tree56977be5b97b14d6731823942986692b3993345c /src
parentf3b3be74dee8407688fafa69109d78c2cd59f8f1 (diff)
downloademacs-4ddf94bd81d39f0db81d1e387aee608492862632.tar.gz
emacs-4ddf94bd81d39f0db81d1e387aee608492862632.zip
* nsterm.m (x_set_window_size): Change back to calculated method
of setting toolbar height under Cocoa. (Bug#2546) (EmacsView-windowWillUseStandardFrame:defaultFrame:): New method. (EmacsView-drawRect:): Completely shortcircuit if ns_in_resize.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/nsterm.m56
2 files changed, 43 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 36f806a0878..d5d1e2b87ed 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12009-03-06 Adrian Robert <Adrian.B.Robert@gmail.com>
2
3 * nsterm.m (x_set_window_size): Change back to calculated method
4 of setting toolbar height under Cocoa. (Bug#2546)
5 (EmacsView-windowWillUseStandardFrame:defaultFrame:): New method.
6 (EmacsView-drawRect:): Completely shortcircuit if ns_in_resize.
7
12009-03-06 Kenichi Handa <handa@m17n.org> 82009-03-06 Kenichi Handa <handa@m17n.org>
2 9
3 These changes are to detect incorrect composition sequence without 10 These changes are to detect incorrect composition sequence without
@@ -51,7 +58,7 @@
51 58
522009-03-05 Adrian Robert <Adrian.B.Robert@gmail.com> 592009-03-05 Adrian Robert <Adrian.B.Robert@gmail.com>
53 60
54 * nsterm.m (ns_select): Shortcircuit if reentrant call. 61 * nsterm.m (ns_select): Shortcircuit if reentrant call. (Bug#2564)
55 62
562009-03-05 Kenichi Handa <handa@m17n.org> 632009-03-05 Kenichi Handa <handa@m17n.org>
57 64
diff --git a/src/nsterm.m b/src/nsterm.m
index d34641f6be0..f5458fc0fd0 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1152,21 +1152,21 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
1152 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); 1152 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
1153 pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); 1153 pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
1154 1154
1155 /* If we have a change in toolbar display, calculate height */ 1155 /* If we have a toolbar, take its height into account. */
1156 /* XXX: GNUstep has not yet implemented the first method below, added
1157 in Panther, however the second is incorrect under Cocoa. */
1156 if (tb) 1158 if (tb)
1157 /* XXX: GNUstep has not yet implemented the first method below, added 1159 FRAME_NS_TOOLBAR_HEIGHT (f) =
1158 in Panther, however the second is incorrect under Cocoa. */ 1160#ifdef NS_IMPL_COCOA
1159#ifdef NS_IMPL_GNUSTEP 1161 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
1160 FRAME_NS_TOOLBAR_HEIGHT (f) 1162 /* NOTE: previously this would generate wrong result if toolbar not
1161 = NSHeight ([NSWindow frameRectForContentRect: NSMakeRect (0, 0, 0, 0) 1163 yet displayed and fixing toolbar_height=32 helped, but
1162 styleMask: [window styleMask]]) 1164 now (200903) seems no longer needed */
1163 - FRAME_NS_TITLEBAR_HEIGHT (f);
1164#else 1165#else
1165 FRAME_NS_TOOLBAR_HEIGHT (f) = 32; 1166 NSHeight ([NSWindow frameRectForContentRect: NSMakeRect (0, 0, 0, 0)
1166 /* actually get wrong result here if toolbar not yet displayed 1167 styleMask: [window styleMask]])
1167 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
1168 - FRAME_NS_TITLEBAR_HEIGHT (f); */
1169#endif 1168#endif
1169 - FRAME_NS_TITLEBAR_HEIGHT (f);
1170 else 1170 else
1171 FRAME_NS_TOOLBAR_HEIGHT (f) = 0; 1171 FRAME_NS_TOOLBAR_HEIGHT (f) = 0;
1172 1172
@@ -5293,14 +5293,33 @@ extern void update_window_cursor (struct window *w, int on);
5293/* if we don't do this manually, the window will resize but not move */ 5293/* if we don't do this manually, the window will resize but not move */
5294- (BOOL)windowShouldZoom: (NSWindow *)sender toFrame: (NSRect)newFrame 5294- (BOOL)windowShouldZoom: (NSWindow *)sender toFrame: (NSRect)newFrame
5295{ 5295{
5296 NSTRACE (windowShouldZoom);
5296 [[self window] setFrame: newFrame display: NO]; 5297 [[self window] setFrame: newFrame display: NO];
5297 return YES; 5298 return YES;
5298} 5299}
5299#endif 5300#endif
5300 5301
5301/* Implement this to control size of frame on zoom. 5302
5303/* Override to do something slightly nonstandard, but nice. First click on
5304 zoom button will zoom vertically. Second will zoom completely. Third
5305 returns to original. */
5302- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender 5306- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender
5303 defaultFrame:(NSRect)defaultFrame; */ 5307 defaultFrame:(NSRect)defaultFrame
5308{
5309 NSRect result = [sender frame];
5310 NSTRACE (windowWillUseStandardFrame);
5311
5312 if (result.size.height == defaultFrame.size.height) {
5313 result = defaultFrame;
5314 } else {
5315 result.size.height = defaultFrame.size.height;
5316 result.origin.y = defaultFrame.origin.y;
5317 }
5318
5319 /* A windowWillResize does not get generated at least on Tiger. */
5320 [self windowWillResize: sender toSize: result.size];
5321 return result;
5322}
5304 5323
5305 5324
5306- (void)windowDidDeminiaturize: sender 5325- (void)windowDidDeminiaturize: sender
@@ -5448,18 +5467,13 @@ extern void update_window_cursor (struct window *w, int on);
5448 5467
5449 NSTRACE (drawRect); 5468 NSTRACE (drawRect);
5450 5469
5451 if (!emacsframe || !emacsframe->output_data.ns) 5470 if (!emacsframe || !emacsframe->output_data.ns || ns_in_resize)
5452 return; 5471 return;
5453 5472
5454 if (!ns_in_resize) 5473 ns_clear_frame_area (emacsframe, x, y, width, height);
5455 ns_clear_frame_area (emacsframe, x, y, width, height);
5456 expose_frame (emacsframe, x, y, width, height); 5474 expose_frame (emacsframe, x, y, width, height);
5457
5458 emacsframe->async_visible = 1; 5475 emacsframe->async_visible = 1;
5459 emacsframe->async_iconified = 0; 5476 emacsframe->async_iconified = 0;
5460
5461/* SET_FRAME_GARBAGED (emacsframe);
5462 ns_send_appdefined (-1); */
5463} 5477}
5464 5478
5465 5479