Commit 50dcfe2a authored by David Fuhrmann's avatar David Fuhrmann

macosx: Introduce OSX_EL_CAPITAN runtime check

parent ffa25eff
......@@ -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)
......@@ -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);
......
......@@ -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];
......
......@@ -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-"];
}
......
......@@ -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";
......
......@@ -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 */
......
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