[vlc-commits] macosx: set b_nativeFullscreenMode to true only if we really use this mode

David Fuhrmann git at videolan.org
Sat Mar 17 17:48:18 CET 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sat Mar 17 16:23:39 2012 +0100| [3a3506ab18cd25c3f4b0927ecddbd75916114ca1] | committer: 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: David Fuhrmann <david.fuhrmann at googlemail.com>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=3a3506ab18cd25c3f4b0927ecddbd75916114ca1
---

 modules/gui/macosx/MainWindow.m |   17 +++++++++--------
 modules/gui/macosx/intf.m       |    7 ++++---
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index fa079a0..4f56a2f 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -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);
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index ef3a186..414e9fa 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -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)



More information about the vlc-commits mailing list