[vlc-commits] macosx: Introduce OSX_EL_CAPITAN runtime check

David Fuhrmann git at videolan.org
Sat Oct 10 17:20:59 CEST 2015


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Oct 10 16:54:34 2015 +0200| [51f8a368584c3dc33208d0f23a7486f5bf4e0b3a] | committer: David Fuhrmann

macosx: Introduce OSX_EL_CAPITAN runtime check

(cherry picked from commit 50dcfe2ac56e9f4e8c98f1cd64076047a20ea83e)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=51f8a368584c3dc33208d0f23a7486f5bf4e0b3a
---

 modules/gui/macosx/CompatibilityFixes.h |    4 ++--
 modules/gui/macosx/MainWindowTitle.m    |   10 +++++-----
 modules/gui/macosx/StringUtility.m      |    2 +-
 modules/gui/macosx/about.m              |    2 +-
 modules/gui/macosx/intf.m               |    2 +-
 modules/gui/macosx/misc.m               |    2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
index d193928..56cb4e2 100644
--- a/modules/gui/macosx/CompatibilityFixes.h
+++ b/modules/gui/macosx/CompatibilityFixes.h
@@ -29,8 +29,8 @@
 #define OSX_LION (NSAppKitVersionNumber < 1162 && NSAppKitVersionNumber >= 1115.2)
 #define OSX_MOUNTAIN_LION (NSAppKitVersionNumber < 1244 && NSAppKitVersionNumber >= 1162)
 #define OSX_MAVERICKS (NSAppKitVersionNumber < 1334 && NSAppKitVersionNumber >= 1244)
-#define OSX_YOSEMITE (NSAppKitVersionNumber >= 1334)
-
+#define OSX_YOSEMITE (NSAppKitVersionNumber < 1404 && NSAppKitVersionNumber >= 1334)
+#define OSX_EL_CAPITAN (NSAppKitVersionNumber >= 1404)
 
 #pragma mark -
 #pragma Fixes for OS X Snow Leopard (10.6)
diff --git a/modules/gui/macosx/MainWindowTitle.m b/modules/gui/macosx/MainWindowTitle.m
index edb20ca..d6799d6 100644
--- a/modules/gui/macosx/MainWindowTitle.m
+++ b/modules/gui/macosx/MainWindowTitle.m
@@ -78,7 +78,7 @@
         b_nativeFullscreenMode = var_InheritBool(VLCIntf, "macosx-nativefullscreenmode");
 #endif
 
-    if (!b_nativeFullscreenMode || OSX_YOSEMITE) {
+    if (!b_nativeFullscreenMode || OSX_YOSEMITE || OSX_EL_CAPITAN) {
         [o_fullscreen_btn setHidden: YES];
     }
 
@@ -114,7 +114,7 @@
     NSString *o_name = @"";
     if (OSX_SNOW_LEOPARD) {
         o_name = @"snowleo-";
-    } else if (OSX_YOSEMITE) {
+    } else if (OSX_YOSEMITE || OSX_EL_CAPITAN) {
         o_name = @"yosemite-";
     } else { // OSX_LION, OSX_MOUNTAIN_LION, OSX_MAVERICKS
         o_name = @"lion-";
@@ -158,7 +158,7 @@
     o_green_on_img = [[self getButtonImage:@"window-zoom-on"] retain];
 
     // these files are only available in the yosemite variant
-    if (OSX_YOSEMITE) {
+    if (OSX_YOSEMITE || OSX_EL_CAPITAN) {
         o_fullscreen_img = [[self getButtonImage:@"window-fullscreen"] retain];
         o_fullscreen_over_img = [[self getButtonImage:@"window-fullscreen-over"] retain];
         o_fullscreen_on_img = [[self getButtonImage:@"window-fullscreen-on"] retain];
@@ -193,7 +193,7 @@
 {
     // default image for old version, or if native fullscreen is
     // disabled on yosemite, or if alt key is pressed
-    if (!OSX_YOSEMITE || !b_nativeFullscreenMode || b_alt_pressed) {
+    if (!(OSX_YOSEMITE || OSX_EL_CAPITAN) || !b_nativeFullscreenMode || b_alt_pressed) {
 
         if (b_mouse_over) {
             [o_green_btn setImage: o_green_over_img];
@@ -226,7 +226,7 @@
     else if (sender == o_yellow_btn)
         [[self window] miniaturize: sender];
     else if (sender == o_green_btn) {
-        if (OSX_YOSEMITE && b_nativeFullscreenMode && !b_alt_pressed) {
+        if ((OSX_YOSEMITE || OSX_EL_CAPITAN) && b_nativeFullscreenMode && !b_alt_pressed) {
             [[self window] toggleFullScreen:self];
         } else {
             [[self window] performZoom: sender];
diff --git a/modules/gui/macosx/StringUtility.m b/modules/gui/macosx/StringUtility.m
index 37301e9..27ff1a2 100644
--- a/modules/gui/macosx/StringUtility.m
+++ b/modules/gui/macosx/StringUtility.m
@@ -398,7 +398,7 @@ NSString *toNSStr(const char *str) {
 NSImage *imageFromRes(NSString *o_id)
 {
     NSString *result = @"";
-    if (OSX_YOSEMITE) {
+    if (OSX_YOSEMITE || OSX_EL_CAPITAN) {
         result = [result stringByAppendingString:@"ys-"];
     }
 
diff --git a/modules/gui/macosx/about.m b/modules/gui/macosx/about.m
index d0d644d..54ea23d 100644
--- a/modules/gui/macosx/about.m
+++ b/modules/gui/macosx/about.m
@@ -133,7 +133,7 @@ static VLAboutBox *_o_sharedInstance = nil;
                                                             "\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: "
                                                             "underline; color:#0057ae;\">Help and join us!</span></a>")];
         NSString *fontfamily;
-        if (OSX_YOSEMITE)
+        if (OSX_YOSEMITE || OSX_EL_CAPITAN)
             fontfamily = @"Helvetica Neue";
         else
             fontfamily = @"Lucida Grande";
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index a318399..5623e07 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1561,7 +1561,7 @@ static bool f_appExit = false;
 
         IOReturn success;
         /* work-around a bug in 10.7.4 and 10.7.5, so check for 10.7.x < 10.7.4, 10.8 and 10.6 */
-        if ((NSAppKitVersionNumber >= 1115.2 && NSAppKitVersionNumber < 1138.45) || OSX_MOUNTAIN_LION || OSX_MAVERICKS || OSX_YOSEMITE || OSX_SNOW_LEOPARD) {
+        if ((NSAppKitVersionNumber >= 1115.2 && NSAppKitVersionNumber < 1138.45) || OSX_MOUNTAIN_LION || OSX_MAVERICKS || OSX_YOSEMITE || OSX_EL_CAPITAN || OSX_SNOW_LEOPARD) {
             CFStringRef reasonForActivity = CFStringCreateWithCString(kCFAllocatorDefault, _("VLC media playback"), kCFStringEncodingUTF8);
             if ([self activeVideoPlayback])
                 success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &systemSleepAssertionID);
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 9769172..9eae3ae 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -173,7 +173,7 @@ static bool b_old_spaces_style = YES;
     /* init our fake object attribute */
     blackoutWindows = [[NSMutableArray alloc] initWithCapacity:1];
 
-    if (OSX_MAVERICKS || OSX_YOSEMITE) {
+    if (OSX_MAVERICKS || OSX_YOSEMITE || OSX_EL_CAPITAN) {
         NSUserDefaults *userDefaults = [[NSUserDefaults alloc] init];
         [userDefaults addSuiteNamed:@"com.apple.spaces"];
         /* this is system settings -> mission control -> monitors using different spaces */



More information about the vlc-commits mailing list