Commit dd1222e9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: remove hack for macOS Mavericks

parent 126fb118
......@@ -26,14 +26,12 @@
#pragma mark -
#pragma OS detection code
#define OSX_LION_AND_HIGHER (NSAppKitVersionNumber >= 1115.2)
#define OSX_MOUNTAIN_LION_AND_HIGHER (NSAppKitVersionNumber >= 1162)
#define OSX_MAVERICKS_AND_HIGHER (NSAppKitVersionNumber >= 1244)
#define OSX_YOSEMITE_AND_HIGHER (NSAppKitVersionNumber >= 1334)
#define OSX_EL_CAPITAN_AND_HIGHER (NSAppKitVersionNumber >= 1404)
#define OSX_SIERRA_AND_HIGHER (NSAppKitVersionNumber >= 1485)
#define OSX_SIERRA_DOT_TWO_AND_HIGHER (NSAppKitVersionNumber >= 1504.76) // this is needed to check for MPRemoteCommandCenter
#define OSX_HIGH_SIERRA_AND_HIGHER (NSAppKitVersionNumber >= 1560)
#define OSX_MOJAVE_AND_HIGHER (NSAppKitVersionNumber >= 1639.10)
// Sierra only APIs
#ifndef MAC_OS_X_VERSION_10_12
......
......@@ -37,14 +37,12 @@ static bool b_old_spaces_style = YES;
/* init our fake object attribute */
blackoutWindows = [[NSMutableArray alloc] initWithCapacity:1];
if (OSX_MAVERICKS_AND_HIGHER) {
NSUserDefaults *userDefaults = [[NSUserDefaults alloc] init];
[userDefaults addSuiteNamed:@"com.apple.spaces"];
/* this is system settings -> mission control -> monitors using different spaces */
NSNumber *o_span_displays = [userDefaults objectForKey:@"spans-displays"];
NSUserDefaults *userDefaults = [[NSUserDefaults alloc] init];
[userDefaults addSuiteNamed:@"com.apple.spaces"];
/* this is system settings -> mission control -> monitors using different spaces */
NSNumber *o_span_displays = [userDefaults objectForKey:@"spans-displays"];
b_old_spaces_style = [o_span_displays boolValue];
}
b_old_spaces_style = [o_span_displays boolValue];
}
+ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID
......
......@@ -157,39 +157,4 @@
return nil;
}
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
{
if (!screen)
screen = [self screen];
NSRect screenRect = [screen frame];
NSRect constrainedRect = [super constrainFrameRect:frameRect toScreen:screen];
/*
* Ugly workaround!
* With Mavericks, there is a nasty bug resulting in grey bars on top in fullscreen mode.
* It looks like this is enforced by the os because the window is in the way for the menu bar.
*
* According to the documentation, this constraining can be changed by overwriting this
* method. But in this situation, even the received frameRect is already contrained with the
* menu bars height substracted. This case is detected here, and the full height is
* enforced again.
*
* See #9469 and radar://15583566
*/
BOOL b_inFullscreen = [self fullscreen] || ([self respondsToSelector:@selector(inFullscreenTransition)] && [(VLCVideoWindowCommon *)self inFullscreenTransition]);
if ((OSX_MAVERICKS_AND_HIGHER && !OSX_YOSEMITE_AND_HIGHER) &&
b_inFullscreen &&
constrainedRect.size.width == screenRect.size.width &&
constrainedRect.size.height != screenRect.size.height &&
fabs(screenRect.size.height - constrainedRect.size.height) <= 25.) {
msg_Dbg(getIntf(), "Contrain window height %.1f to screen height %.1f",
constrainedRect.size.height, screenRect.size.height);
constrainedRect.size.height = screenRect.size.height;
}
return constrainedRect;
}
@end
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