Commit 4ddf94bd authored by Adrian Robert's avatar Adrian Robert
Browse files

* 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.
parent f3b3be74
2009-03-06 Adrian Robert <Adrian.B.Robert@gmail.com>
* 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.
2009-03-06 Kenichi Handa <handa@m17n.org> 2009-03-06 Kenichi Handa <handa@m17n.org>
   
These changes are to detect incorrect composition sequence without These changes are to detect incorrect composition sequence without
...@@ -51,7 +58,7 @@ ...@@ -51,7 +58,7 @@
   
2009-03-05 Adrian Robert <Adrian.B.Robert@gmail.com> 2009-03-05 Adrian Robert <Adrian.B.Robert@gmail.com>
   
* nsterm.m (ns_select): Shortcircuit if reentrant call. * nsterm.m (ns_select): Shortcircuit if reentrant call. (Bug#2564)
   
2009-03-05 Kenichi Handa <handa@m17n.org> 2009-03-05 Kenichi Handa <handa@m17n.org>
   
......
...@@ -1152,21 +1152,21 @@ Free a pool and temporary objects it refers to (callable from C) ...@@ -1152,21 +1152,21 @@ Free a pool and temporary objects it refers to (callable from C)
pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
/* If we have a change in toolbar display, calculate height */ /* If we have a toolbar, take its height into account. */
/* XXX: GNUstep has not yet implemented the first method below, added
in Panther, however the second is incorrect under Cocoa. */
if (tb) if (tb)
/* XXX: GNUstep has not yet implemented the first method below, added FRAME_NS_TOOLBAR_HEIGHT (f) =
in Panther, however the second is incorrect under Cocoa. */ #ifdef NS_IMPL_COCOA
#ifdef NS_IMPL_GNUSTEP NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
FRAME_NS_TOOLBAR_HEIGHT (f) /* NOTE: previously this would generate wrong result if toolbar not
= NSHeight ([NSWindow frameRectForContentRect: NSMakeRect (0, 0, 0, 0) yet displayed and fixing toolbar_height=32 helped, but
styleMask: [window styleMask]]) now (200903) seems no longer needed */
- FRAME_NS_TITLEBAR_HEIGHT (f);
#else #else
FRAME_NS_TOOLBAR_HEIGHT (f) = 32; NSHeight ([NSWindow frameRectForContentRect: NSMakeRect (0, 0, 0, 0)
/* actually get wrong result here if toolbar not yet displayed styleMask: [window styleMask]])
NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
- FRAME_NS_TITLEBAR_HEIGHT (f); */
#endif #endif
- FRAME_NS_TITLEBAR_HEIGHT (f);
else else
FRAME_NS_TOOLBAR_HEIGHT (f) = 0; FRAME_NS_TOOLBAR_HEIGHT (f) = 0;
...@@ -5293,14 +5293,33 @@ - (void)windowDidMove: sender ...@@ -5293,14 +5293,33 @@ - (void)windowDidMove: sender
/* if we don't do this manually, the window will resize but not move */ /* if we don't do this manually, the window will resize but not move */
- (BOOL)windowShouldZoom: (NSWindow *)sender toFrame: (NSRect)newFrame - (BOOL)windowShouldZoom: (NSWindow *)sender toFrame: (NSRect)newFrame
{ {
NSTRACE (windowShouldZoom);
[[self window] setFrame: newFrame display: NO]; [[self window] setFrame: newFrame display: NO];
return YES; return YES;
} }
#endif #endif
/* Implement this to control size of frame on zoom.
/* Override to do something slightly nonstandard, but nice. First click on
zoom button will zoom vertically. Second will zoom completely. Third
returns to original. */
- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender - (NSRect)windowWillUseStandardFrame:(NSWindow *)sender
defaultFrame:(NSRect)defaultFrame; */ defaultFrame:(NSRect)defaultFrame
{
NSRect result = [sender frame];
NSTRACE (windowWillUseStandardFrame);
if (result.size.height == defaultFrame.size.height) {
result = defaultFrame;
} else {
result.size.height = defaultFrame.size.height;
result.origin.y = defaultFrame.origin.y;
}
/* A windowWillResize does not get generated at least on Tiger. */
[self windowWillResize: sender toSize: result.size];
return result;
}
- (void)windowDidDeminiaturize: sender - (void)windowDidDeminiaturize: sender
...@@ -5448,18 +5467,13 @@ - (void)drawRect: (NSRect)rect ...@@ -5448,18 +5467,13 @@ - (void)drawRect: (NSRect)rect
NSTRACE (drawRect); NSTRACE (drawRect);
if (!emacsframe || !emacsframe->output_data.ns) if (!emacsframe || !emacsframe->output_data.ns || ns_in_resize)
return; return;
if (!ns_in_resize) ns_clear_frame_area (emacsframe, x, y, width, height);
ns_clear_frame_area (emacsframe, x, y, width, height);
expose_frame (emacsframe, x, y, width, height); expose_frame (emacsframe, x, y, width, height);
emacsframe->async_visible = 1; emacsframe->async_visible = 1;
emacsframe->async_iconified = 0; emacsframe->async_iconified = 0;
/* SET_FRAME_GARBAGED (emacsframe);
ns_send_appdefined (-1); */
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment