Commit de742db2 authored by David Fuhrmann's avatar David Fuhrmann

macosx: set b_nativeFullscreenMode to true only if we really use this mode

This simplifies the code in several lines.
parent 73592ab3
...@@ -126,6 +126,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -126,6 +126,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
/* setup the styled interface */ /* setup the styled interface */
b_nativeFullscreenMode = NO; b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7 #ifdef MAC_OS_X_VERSION_10_7
if( OSX_LION )
b_nativeFullscreenMode = config_GetInt( VLCIntf, "macosx-nativefullscreenmode" ); b_nativeFullscreenMode = config_GetInt( VLCIntf, "macosx-nativefullscreenmode" );
#endif #endif
i_lastShownVolume = -1; i_lastShownVolume = -1;
...@@ -187,7 +188,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -187,7 +188,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low"]]; [o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low"]];
[o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track"]]; [o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track"]];
[o_volume_up_btn setImage: [NSImage imageNamed:@"volume-high"]]; [o_volume_up_btn setImage: [NSImage imageNamed:@"volume-high"]];
if (OSX_LION && b_nativeFullscreenMode) if (b_nativeFullscreenMode)
{ {
[o_effects_btn setImage: [NSImage imageNamed:@"effects-one-button"]]; [o_effects_btn setImage: [NSImage imageNamed:@"effects-one-button"]];
[o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-one-button-blue"]]; [o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-one-button-blue"]];
...@@ -239,7 +240,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -239,7 +240,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low_dark"]]; [o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low_dark"]];
[o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track_dark"]]; [o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track_dark"]];
[o_volume_up_btn setImage: [NSImage imageNamed:@"volume-high_dark"]]; [o_volume_up_btn setImage: [NSImage imageNamed:@"volume-high_dark"]];
if (OSX_LION && b_nativeFullscreenMode) if (b_nativeFullscreenMode)
{ {
[o_effects_btn setImage: [NSImage imageNamed:@"effects-one-button_dark"]]; [o_effects_btn setImage: [NSImage imageNamed:@"effects-one-button_dark"]];
[o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-one-button-blue_dark"]]; [o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-one-button-blue_dark"]];
...@@ -287,7 +288,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -287,7 +288,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
[o_dropzone_view setFrame: [o_playlist_table frame]]; [o_dropzone_view setFrame: [o_playlist_table frame]];
[o_left_split_view setFrame: [o_sidebar_view frame]]; [o_left_split_view setFrame: [o_sidebar_view frame]];
if (OSX_LION && b_nativeFullscreenMode) if (b_nativeFullscreenMode)
{ {
NSRect frame; NSRect frame;
[self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary]; [self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary];
...@@ -1375,7 +1376,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1375,7 +1376,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (id)setupVideoView - (id)setupVideoView
{ {
vout_thread_t *p_vout = getVout(); vout_thread_t *p_vout = getVout();
if (config_GetInt( VLCIntf, "embedded-video" ) || (OSX_LION && b_nativeFullscreenMode)) if (config_GetInt( VLCIntf, "embedded-video" ) || b_nativeFullscreenMode)
{ {
if ([o_video_view window] != self) if ([o_video_view window] != self)
{ {
...@@ -1420,7 +1421,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1420,7 +1421,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (!b_videoPlayback) if (!b_videoPlayback)
[o_detached_video_window orderOut: nil]; [o_detached_video_window orderOut: nil];
if( OSX_LION && b_nativeFullscreenMode ) if( b_nativeFullscreenMode )
{ {
if( [NSApp presentationOptions] & NSApplicationPresentationFullScreen ) if( [NSApp presentationOptions] & NSApplicationPresentationFullScreen )
[o_bottombar_view setHidden: b_videoPlayback]; [o_bottombar_view setHidden: b_videoPlayback];
...@@ -1436,14 +1437,14 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1436,14 +1437,14 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (!b_videoPlayback && b_fullscreen) if (!b_videoPlayback && b_fullscreen)
{ {
if (!b_nativeFullscreenMode || !OSX_LION) if (!b_nativeFullscreenMode)
[[VLCCoreInteraction sharedInstance] toggleFullscreen]; [[VLCCoreInteraction sharedInstance] toggleFullscreen];
} }
} }
- (void)resizeWindow - (void)resizeWindow
{ {
if ( b_fullscreen || (OSX_LION && [NSApp presentationOptions] & NSApplicationPresentationFullScreen && b_nativeFullscreenMode) ) if ( b_fullscreen || (b_nativeFullscreenMode && [NSApp presentationOptions] & NSApplicationPresentationFullScreen ))
return; return;
NSPoint topleftbase = NSMakePoint(0, [self frame].size.height); NSPoint topleftbase = NSMakePoint(0, [self frame].size.height);
......
...@@ -614,6 +614,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -614,6 +614,7 @@ static VLCMain *_o_sharedMainInstance = nil;
/* yeah, we are done */ /* yeah, we are done */
b_nativeFullscreenMode = NO; b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7 #ifdef MAC_OS_X_VERSION_10_7
if( OSX_LION )
b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" ); b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" );
#endif #endif
nib_main_loaded = TRUE; nib_main_loaded = TRUE;
...@@ -697,7 +698,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -697,7 +698,7 @@ static VLCMain *_o_sharedMainInstance = nil;
int returnedValue = 0; int returnedValue = 0;
/* always exit fullscreen on quit, otherwise we get ugly artifacts on the next launch */ /* always exit fullscreen on quit, otherwise we get ugly artifacts on the next launch */
if (OSX_LION && b_nativeFullscreenMode) if (b_nativeFullscreenMode)
{ {
[o_mainwindow toggleFullScreen: self]; [o_mainwindow toggleFullScreen: self];
[NSApp setPresentationOptions:(NSApplicationPresentationDefault)]; [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
...@@ -1371,7 +1372,7 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1371,7 +1372,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
playlist_t * p_playlist = pl_Get( VLCIntf ); playlist_t * p_playlist = pl_Get( VLCIntf );
BOOL b_fullscreen = var_GetBool( p_playlist, "fullscreen" ); BOOL b_fullscreen = var_GetBool( p_playlist, "fullscreen" );
if (OSX_LION && b_nativeFullscreenMode) if (b_nativeFullscreenMode)
{ {
[o_mainwindow toggleFullScreen: self]; [o_mainwindow toggleFullScreen: self];
if(b_fullscreen) if(b_fullscreen)
......
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