Index: modules/gui/macosx/vout.h =================================================================== --- modules/gui/macosx/vout.h (revision 18788) +++ modules/gui/macosx/vout.h (working copy) @@ -58,7 +58,7 @@ - (void)closeVout; - (void)updateTitle; - (void)manage; -- (void)scaleWindowWithFactor: (float)factor; +- (void)scaleWindowWithFactor: (float)factor animate: (BOOL)animate; - (void)setOnTop:(BOOL)b_on_top; - (void)toggleFloatOnTop; - (void)toggleFullscreen; Index: modules/gui/macosx/vout.m =================================================================== --- modules/gui/macosx/vout.m (revision 18788) +++ modules/gui/macosx/vout.m (working copy) @@ -316,7 +316,7 @@ } } -- (void)scaleWindowWithFactor: (float)factor +- (void)scaleWindowWithFactor: (float)factor animate: (BOOL)animate { NSSize newsize; int i_corrected_height, i_corrected_width; @@ -355,7 +355,7 @@ new_frame.origin.x = topleftscreen.x; new_frame.origin.y = topleftscreen.y - new_frame.size.height; - [o_window setFrame: new_frame display: NO]; + [o_window setFrame: new_frame display: animate animate: animate]; p_vout->i_changes |= VOUT_SIZE_CHANGE; } @@ -877,7 +877,7 @@ { [o_window setAlphaValue: var_GetFloat( p_vout, "macosx-opaqueness" )]; [self updateTitle]; - [self scaleWindowWithFactor: 1.0]; + [self scaleWindowWithFactor: 1.0 animate: NO]; [o_window makeKeyAndOrderFront: self]; } return b_return; Index: modules/gui/macosx/embeddedwindow.h =================================================================== --- modules/gui/macosx/embeddedwindow.h (revision 18788) +++ modules/gui/macosx/embeddedwindow.h (working copy) @@ -26,7 +26,7 @@ *****************************************************************************/ -@interface VLCEmbeddedWindow : NSObject +@interface VLCEmbeddedWindow : NSWindow { IBOutlet id o_btn_backward; IBOutlet id o_btn_forward; @@ -34,12 +34,13 @@ IBOutlet id o_btn_play; IBOutlet id o_slider; IBOutlet id o_time; - IBOutlet id o_window; NSImage * o_img_play; NSImage * o_img_play_pressed; NSImage * o_img_pause; NSImage * o_img_pause_pressed; + + NSRect o_saved_frame; } - (void)setTime:(NSString *)o_arg_ime position:(float)f_position; Index: modules/gui/macosx/embeddedwindow.m =================================================================== --- modules/gui/macosx/embeddedwindow.m (revision 18788) +++ modules/gui/macosx/embeddedwindow.m (working copy) @@ -37,7 +37,7 @@ - (void)awakeFromNib { - [o_window setDelegate: self]; + [self setDelegate: self]; [o_btn_backward setToolTip: _NS("Rewind")]; [o_btn_forward setToolTip: _NS("Fast Forward")]; @@ -49,6 +49,8 @@ o_img_play_pressed = [NSImage imageNamed: @"play_embedded_blue"]; o_img_pause = [NSImage imageNamed: @"pause_embedded"]; o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_blue"]; + + o_saved_frame = NSMakeRect( 0.0f, 0.0f, 0.0f, 0.0f ); } - (void)setTime:(NSString *)o_arg_time position:(float)f_position @@ -85,6 +87,26 @@ [o_btn_fullscreen setState: b_fullscreen]; } +- (void)zoom:(id)sender +{ + if( ![self isZoomed] ) + { + NSRect zoomRect = [[self screen] frame]; + o_saved_frame = [self frame]; + /* we don't have to take care of the eventual menu bar and dock + as zoomRect will be cropped automatically by setFrame:display: + to the right rectangle */ + [self setFrame: zoomRect display: YES animate: YES]; + } + else + { + /* unzoom to the saved_frame if the o_saved_frame coords look sound + (just in case) */ + if( o_saved_frame.size.width > 0 && o_saved_frame.size.height > 0 ) + [self setFrame: o_saved_frame display: YES animate: YES]; + } +} + - (BOOL)windowShouldClose:(id)sender { playlist_t * p_playlist = pl_Yield( VLCIntf ); Index: modules/gui/macosx/controls.m =================================================================== --- modules/gui/macosx/controls.m (revision 18788) +++ modules/gui/macosx/controls.m (working copy) @@ -422,11 +422,11 @@ if( o_vout_view ) { if( [o_title isEqualToString: _NS("Half Size") ] ) - [o_vout_view scaleWindowWithFactor: 0.5]; + [o_vout_view scaleWindowWithFactor: 0.5 animate: YES]; else if( [o_title isEqualToString: _NS("Normal Size") ] ) - [o_vout_view scaleWindowWithFactor: 1.0]; + [o_vout_view scaleWindowWithFactor: 1.0 animate: YES]; else if( [o_title isEqualToString: _NS("Double Size") ] ) - [o_vout_view scaleWindowWithFactor: 2.0]; + [o_vout_view scaleWindowWithFactor: 2.0 animate: YES]; else if( [o_title isEqualToString: _NS("Float on Top") ] ) [o_vout_view toggleFloatOnTop]; else if( [o_title isEqualToString: _NS("Fit to Screen") ] )