From: Pierre d'Herbemont Date: Fri, 11 May 2007 19:19:11 +0000 (+0000) Subject: Mac OS X gui: Make sure maximized window respect Mac OS X Dock area. (Fix #1190) X-Git-Tag: 0.9.0-test0~7494 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9375a0d8d125a644a5c2dcff25f00a254f89ef8e;p=vlc Mac OS X gui: Make sure maximized window respect Mac OS X Dock area. (Fix #1190) --- diff --git a/modules/gui/macosx/embeddedwindow.h b/modules/gui/macosx/embeddedwindow.h index 9831cb0971..201872e7fe 100644 --- a/modules/gui/macosx/embeddedwindow.h +++ b/modules/gui/macosx/embeddedwindow.h @@ -41,8 +41,6 @@ NSImage * o_img_play_pressed; NSImage * o_img_pause; NSImage * o_img_pause_pressed; - - NSRect o_saved_frame; VLCWindow * o_fullscreen_window; NSViewAnimation * o_fullscreen_anim1; diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m index ee71da2a3e..e9836d407c 100644 --- a/modules/gui/macosx/embeddedwindow.m +++ b/modules/gui/macosx/embeddedwindow.m @@ -55,8 +55,6 @@ 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 ); - /* Useful to save o_view frame in fullscreen mode */ o_temp_view = [[NSView alloc] init]; [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; @@ -103,24 +101,10 @@ [o_slider setEnabled: b_seekable]; } -- (void)zoom:(id)sender +- (BOOL)windowShouldZoom:(NSWindow *)sender toFrame:(NSRect)newFrame { - 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]; - } + [self setFrame: newFrame display: YES animate: YES]; + return YES; } - (BOOL)windowShouldClose:(id)sender