[vlc-commits] macosx: remove hack for macOS Mavericks
Felix Paul Kühne
git at videolan.org
Sun Jun 10 12:26:12 CEST 2018
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sun Jun 10 11:55:32 2018 +0200| [629a8aca5e0ece7009a5a9fc5dd05f133c36944c] | committer: Felix Paul Kühne
macosx: remove hack for macOS Mavericks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=629a8aca5e0ece7009a5a9fc5dd05f133c36944c
---
modules/gui/macosx/CompatibilityFixes.h | 4 +---
modules/gui/macosx/NSScreen+VLCAdditions.m | 12 +++++-----
modules/gui/macosx/VLCWindow.m | 35 ------------------------------
3 files changed, 6 insertions(+), 45 deletions(-)
diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
index 3a52279975..5af0d7aaf2 100644
--- a/modules/gui/macosx/CompatibilityFixes.h
+++ b/modules/gui/macosx/CompatibilityFixes.h
@@ -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
diff --git a/modules/gui/macosx/NSScreen+VLCAdditions.m b/modules/gui/macosx/NSScreen+VLCAdditions.m
index 5c4aeca1a3..ea3ebf5a3e 100644
--- a/modules/gui/macosx/NSScreen+VLCAdditions.m
+++ b/modules/gui/macosx/NSScreen+VLCAdditions.m
@@ -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
diff --git a/modules/gui/macosx/VLCWindow.m b/modules/gui/macosx/VLCWindow.m
index a92418f166..a5f8823ebd 100644
--- a/modules/gui/macosx/VLCWindow.m
+++ b/modules/gui/macosx/VLCWindow.m
@@ -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
More information about the vlc-commits
mailing list