Commit 3a3506ab 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.
(cherry picked from commit de742db20a39f116ca2505926fe1a0e9c20de47a)
Signed-off-by: default avatarDavid Fuhrmann <david.fuhrmann@googlemail.com>
parent 233f70b5
......@@ -126,7 +126,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
/* setup the styled interface */
b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7
b_nativeFullscreenMode = config_GetInt( VLCIntf, "macosx-nativefullscreenmode" );
if( OSX_LION )
b_nativeFullscreenMode = config_GetInt( VLCIntf, "macosx-nativefullscreenmode" );
#endif
i_lastShownVolume = -1;
t_hide_mouse_timer = nil;
......@@ -187,7 +188,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low"]];
[o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track"]];
[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 setAlternateImage: [NSImage imageNamed:@"effects-one-button-blue"]];
......@@ -239,7 +240,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low_dark"]];
[o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track_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 setAlternateImage: [NSImage imageNamed:@"effects-one-button-blue_dark"]];
......@@ -287,7 +288,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
[o_dropzone_view setFrame: [o_playlist_table frame]];
[o_left_split_view setFrame: [o_sidebar_view frame]];
if (OSX_LION && b_nativeFullscreenMode)
if (b_nativeFullscreenMode)
{
NSRect frame;
[self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary];
......@@ -1375,7 +1376,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (id)setupVideoView
{
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)
{
......@@ -1420,7 +1421,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (!b_videoPlayback)
[o_detached_video_window orderOut: nil];
if( OSX_LION && b_nativeFullscreenMode )
if( b_nativeFullscreenMode )
{
if( [NSApp presentationOptions] & NSApplicationPresentationFullScreen )
[o_bottombar_view setHidden: b_videoPlayback];
......@@ -1436,14 +1437,14 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (!b_videoPlayback && b_fullscreen)
{
if (!b_nativeFullscreenMode || !OSX_LION)
if (!b_nativeFullscreenMode)
[[VLCCoreInteraction sharedInstance] toggleFullscreen];
}
}
- (void)resizeWindow
{
if ( b_fullscreen || (OSX_LION && [NSApp presentationOptions] & NSApplicationPresentationFullScreen && b_nativeFullscreenMode) )
if ( b_fullscreen || (b_nativeFullscreenMode && [NSApp presentationOptions] & NSApplicationPresentationFullScreen ))
return;
NSPoint topleftbase = NSMakePoint(0, [self frame].size.height);
......
......@@ -614,7 +614,8 @@ static VLCMain *_o_sharedMainInstance = nil;
/* yeah, we are done */
b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7
b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" );
if( OSX_LION )
b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" );
#endif
nib_main_loaded = TRUE;
}
......@@ -697,7 +698,7 @@ static VLCMain *_o_sharedMainInstance = nil;
int returnedValue = 0;
/* 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];
[NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
......@@ -1371,7 +1372,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
playlist_t * p_playlist = pl_Get( VLCIntf );
BOOL b_fullscreen = var_GetBool( p_playlist, "fullscreen" );
if (OSX_LION && b_nativeFullscreenMode)
if (b_nativeFullscreenMode)
{
[o_mainwindow toggleFullScreen: self];
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