[vlc-commits] macosx: only enable Lion' s fullscreen mode in case VLC was linked against the 10.7 SDK

Felix Paul Kühne git at videolan.org
Wed Jan 11 21:16:19 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jan 11 21:16:15 2012 +0100| [0e608f941642aa0620fb07431eee25c92f329751] | committer: Felix Paul Kühne

macosx: only enable Lion's fullscreen mode in case VLC was linked against the 10.7 SDK

plus some other fixes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e608f941642aa0620fb07431eee25c92f329751
---

 modules/gui/macosx/MainMenu.m     |   17 ++++++++++-------
 modules/gui/macosx/MainWindow.m   |    4 ++++
 modules/gui/macosx/simple_prefs.m |    5 +++--
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index 657a7e3..c1884d0 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -486,20 +486,23 @@ static VLCMainMenu *_o_sharedInstance = nil;
     }
 
     NSArray * o_screens = [NSScreen screens];
+    NSMenuItem * o_mitem;
     count = [o_screens count];
     [o_submenu addItemWithTitle: _NS("Default") action:@selector(toggleFullscreenDevice:) keyEquivalent:@""];
-    [[o_submenu itemAtIndex: 0] setTag: 0];
-    [[o_submenu itemAtIndex: 0] setEnabled: YES];
-    [[o_submenu itemAtIndex: 0] setTarget: self];
+    o_mitem = [o_submenu itemAtIndex: 0];
+    [o_mitem setTag: 0];
+    [o_mitem setEnabled: YES];
+    [o_mitem setTarget: self];
     NSRect s_rect;
     for (NSUInteger i = 0; i < count; i++)
     {
         s_rect = [[o_screens objectAtIndex: i] frame];
         [o_submenu addItemWithTitle: [NSString stringWithFormat: @"%@ %i (%ix%i)", _NS("Screen"), i+1,
                                       (int)s_rect.size.width, (int)s_rect.size.height] action:@selector(toggleFullscreenDevice:) keyEquivalent:@""];
-        [[o_submenu itemAtIndex:i+1] setTag: (int)[[o_screens objectAtIndex: i] displayID]];
-        [[o_submenu itemAtIndex:i+1] setEnabled: YES];
-        [[o_submenu itemAtIndex:i+1] setTarget: self];
+        o_mitem = [o_submenu itemAtIndex:i+1];
+        [o_mitem setTag: (int)[[o_screens objectAtIndex: i] displayID]];
+        [o_mitem setEnabled: YES];
+        [o_mitem setTarget: self];
     }
     [[o_submenu itemWithTag: config_GetInt( VLCIntf, "macosx-vdev" )] setState: NSOnState];
 }
@@ -1169,7 +1172,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
     }
     else if( [o_title isEqualToString: _NS("Mute")] )
     {
-        //FIXME [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
+        [o_mi setState: [[VLCCoreInteraction sharedInstance] isMuted] ? NSOnState : NSOffState];
         [self setupMenus]; /* Make sure audio menu is up to date */
     }
     else if( [o_title isEqualToString: _NS("Half Size")] ||
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index df746d6..186392d 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -119,7 +119,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
 - (void)awakeFromNib
 {
     /* setup the styled interface */
+#ifdef MAC_OS_X_VERSION_10_7
     b_nativeFullscreenMode = config_GetInt( VLCIntf, "macosx-nativefullscreenmode" );
+#else
+    b_nativeFullscreenMode = NO;
+#endif
     i_lastShownVolume = -1;
     t_hide_mouse_timer = nil;
 
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index ce884df..02af0a0 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -133,8 +133,9 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 
     if (OSX_LION)
         [o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
-    else
-        [o_intf_nativefullscreen_ckb setEnabled:NO];
+#ifndef MAC_OS_X_VERSION_10_7
+    [o_intf_nativefullscreen_ckb setEnabled:NO];
+#endif
 
     /* setup useful stuff */
     o_hotkeysNonUseableKeys = [[NSArray arrayWithObjects: @"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-z", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", nil] retain];



More information about the vlc-commits mailing list