[vlc-commits] macosx: Introduce OSX_EL_CAPITAN runtime check
David Fuhrmann
git at videolan.org
Sat Oct 10 17:00:12 CEST 2015
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Oct 10 16:54:34 2015 +0200| [50dcfe2ac56e9f4e8c98f1cd64076047a20ea83e] | committer: David Fuhrmann
macosx: Introduce OSX_EL_CAPITAN runtime check
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=50dcfe2ac56e9f4e8c98f1cd64076047a20ea83e
---
modules/gui/macosx/CompatibilityFixes.h | 3 ++-
modules/gui/macosx/InputManager.m | 2 +-
modules/gui/macosx/MainWindowTitle.m | 10 +++++-----
modules/gui/macosx/StringUtility.m | 2 +-
modules/gui/macosx/about.m | 2 +-
modules/gui/macosx/misc.m | 2 +-
6 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
index b113990..a3e5a56 100644
--- a/modules/gui/macosx/CompatibilityFixes.h
+++ b/modules/gui/macosx/CompatibilityFixes.h
@@ -28,4 +28,5 @@
#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)
diff --git a/modules/gui/macosx/InputManager.m b/modules/gui/macosx/InputManager.m
index b881221..368f127 100644
--- a/modules/gui/macosx/InputManager.m
+++ b/modules/gui/macosx/InputManager.m
@@ -304,7 +304,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
IOReturn success;
/* work-around a bug in 10.7.4 and 10.7.5, so check for 10.7.x < 10.7.4 and 10.8 */
- if ((NSAppKitVersionNumber >= 1115.2 && NSAppKitVersionNumber < 1138.45) || OSX_MOUNTAIN_LION || OSX_MAVERICKS || OSX_YOSEMITE) {
+ if ((NSAppKitVersionNumber >= 1115.2 && NSAppKitVersionNumber < 1138.45) || OSX_MOUNTAIN_LION || OSX_MAVERICKS || OSX_YOSEMITE || OSX_EL_CAPITAN) {
CFStringRef reasonForActivity = CFStringCreateWithCString(kCFAllocatorDefault, _("VLC media playback"), kCFStringEncodingUTF8);
if ([o_main activeVideoPlayback])
success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &systemSleepAssertionID);
diff --git a/modules/gui/macosx/MainWindowTitle.m b/modules/gui/macosx/MainWindowTitle.m
index 472a279..5e7921e 100644
--- a/modules/gui/macosx/MainWindowTitle.m
+++ b/modules/gui/macosx/MainWindowTitle.m
@@ -84,7 +84,7 @@
{
b_nativeFullscreenMode = var_InheritBool(VLCIntf, "macosx-nativefullscreenmode");
- if (!b_nativeFullscreenMode || OSX_YOSEMITE) {
+ if (!b_nativeFullscreenMode || OSX_YOSEMITE || OSX_EL_CAPITAN) {
[o_fullscreen_btn setHidden: YES];
}
@@ -118,7 +118,7 @@
- (NSImage *)getButtonImage:(NSString *)o_id
{
NSString *o_name = @"";
- if (OSX_YOSEMITE) {
+ if (OSX_YOSEMITE || OSX_EL_CAPITAN) {
o_name = @"yosemite-";
} else { // OSX_LION, OSX_MOUNTAIN_LION, OSX_MAVERICKS
o_name = @"lion-";
@@ -146,7 +146,7 @@
o_green_on_img = [self getButtonImage:@"window-zoom-on"];
// 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"];
o_fullscreen_over_img = [self getButtonImage:@"window-fullscreen-over"];
o_fullscreen_on_img = [self getButtonImage:@"window-fullscreen-on"];
@@ -181,7 +181,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];
@@ -214,7 +214,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 112b1ab..f920315 100644
--- a/modules/gui/macosx/StringUtility.m
+++ b/modules/gui/macosx/StringUtility.m
@@ -532,7 +532,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 42484e3..45ea959 100644
--- a/modules/gui/macosx/about.m
+++ b/modules/gui/macosx/about.m
@@ -139,7 +139,7 @@
"\"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/misc.m b/modules/gui/macosx/misc.m
index 2d8e3ed..25cdd99 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