-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some deprecated issues #5130
base: develop
Are you sure you want to change the base?
Conversation
Works fine in intel and Apple Silicon
iina/MainWindowController.swift
Outdated
@@ -710,7 +710,7 @@ class MainWindowController: PlayerWindowController { | |||
} | |||
|
|||
private func setupOSCToolbarButtons(_ buttons: [Preference.ToolBarButton]) { | |||
var buttons = buttons | |||
let buttons = buttons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let buttons = buttons |
There's no reason to shadow buttons
here, just delete it.
@@ -57,7 +57,7 @@ class PlaySliderCell: NSSliderCell { | |||
NSGraphicsContext.saveGraphicsState() | |||
let shadow = NSShadow() | |||
shadow.shadowBlurRadius = 1 | |||
shadow.shadowColor = .controlShadowColor | |||
shadow.shadowColor = NSColor.separatorColor // Use the separatorColor for shadows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shadow.shadowColor = NSColor.separatorColor // Use the separatorColor for shadows | |
shadow.shadowColor = .separatorColor |
@@ -68,7 +68,7 @@ class PlaySliderCell: NSSliderCell { | |||
|
|||
if isLightTheme { | |||
path.lineWidth = 0.4 | |||
NSColor.controlShadowColor.setStroke() | |||
NSColor.separatorColor.setStroke() // Use separatorColor instead of controlShadowColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSColor.separatorColor.setStroke() // Use separatorColor instead of controlShadowColor | |
NSColor.separatorColor.setStroke() |
I'm not sure whether or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code in FFmpegController
is needed and must not be removed. See my comment on the change for details.
} else if (@available(macOS 10.15.4, *)) { | ||
cgColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020_PQ); | ||
} else if (@available(macOS 10.14.6, *)) { | ||
cgColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020_PQ_EOTF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code must not be removed.
Thank you very much for working to reduce the deprecated warnings. The IINA project considers it important to fix compiler warnings. Your help is appreciated. Unfortunately Xcode is BROKEN and can trick you into removing code that is needed. The file Configs/Deployment.xconfig
contains:
MACOSX_DEPLOYMENT_TARGET = 10.15
MACOSX_DEPLOYMENT_TARGET[arch=arm64] = 12
This has confused Xcode and it is emitting deprecated messages as if the minimum macOS version for IINA is macOS Monterey. It is not. The minimum macOS version is macOS Catalina. If you are building on a Mac with a M series chip, in Xcode change your build destination to My Mac (Rosetta)
then clean and rebuild. You will see many of these deprecated warnings disappear. To do that you may have to enable the Rosetta destination. Apple is pushing developers away from Rosetta by hiding that destination in Xcode by default. If you have trouble enabling Rosetta another way to see this is to change the above file to use 10.15
for arch=arm64
then clean and rebuild.
if (@available(macOS 10.15.4, *)) { | ||
cgColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3_PQ); | ||
} else if (@available(macOS 10.14.6, *)) { | ||
cgColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3_PQ_EOTF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS 10.15 is still supported, so this code can not be removed.
Description:
In reviewing the code, I identified several deprecated APIs that need to be updated to ensure compatibility with the latest macOS versions. To address these issues, I have replaced the deprecated methods with their modern counterparts, aligning with current best practices and API recommendations.
Works fine in intel and Apple Silicon with Xcode 15.4