Some minor changes + UI compatibility setting for Tahoe so the project properly compiles using Xcode 26.
This commit is contained in:
waydabber 2026-04-19 08:37:34 +02:00 committed by GitHub
parent fc19ce2bd2
commit 3cfc40598a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 18 additions and 14 deletions

View file

@ -881,7 +881,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 10.14; MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 4.3.2; MARKETING_VERSION = 4.3.4;
PRODUCT_BUNDLE_IDENTIFIER = app.monitorcontrol.MonitorControl; PRODUCT_BUNDLE_IDENTIFIER = app.monitorcontrol.MonitorControl;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -918,7 +918,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 10.14; MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 4.3.2; MARKETING_VERSION = 4.3.4;
PRODUCT_BUNDLE_IDENTIFIER = app.monitorcontrol.MonitorControl; PRODUCT_BUNDLE_IDENTIFIER = app.monitorcontrol.MonitorControl;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View file

@ -168,5 +168,5 @@ enum Command: UInt8 {
case bottomLeftScreenPurity = 0xEA case bottomLeftScreenPurity = 0xEA
case bottomRightScreenPurity = 0xEB case bottomRightScreenPurity = 0xEB
public static let brightness = luminance static let brightness = luminance
} }

View file

@ -36,5 +36,7 @@
<string>https://monitorcontrol.app/appcast2.xml</string> <string>https://monitorcontrol.app/appcast2.xml</string>
<key>SUPublicEDKey</key> <key>SUPublicEDKey</key>
<string>ITSTMp8AypsLawojJ+UR3tm2mN18AFoNMvXf1G3t62s=</string> <string>ITSTMp8AypsLawojJ+UR3tm2mN18AFoNMvXf1G3t62s=</string>
<key>UIDesignRequiresCompatibility</key>
<true/>
</dict> </dict>
</plist> </plist>

View file

@ -11,7 +11,7 @@ class AppleDisplay: Display {
super.init(identifier, name: name, vendorNumber: vendorNumber, modelNumber: modelNumber, serialNumber: serialNumber, isVirtual: isVirtual, isDummy: isDummy) super.init(identifier, name: name, vendorNumber: vendorNumber, modelNumber: modelNumber, serialNumber: serialNumber, isVirtual: isVirtual, isDummy: isDummy)
} }
public func getAppleBrightness() -> Float { func getAppleBrightness() -> Float {
guard !self.isDummy else { guard !self.isDummy else {
return 1 return 1
} }
@ -20,7 +20,7 @@ class AppleDisplay: Display {
return brightness return brightness
} }
public func setAppleBrightness(value: Float) { func setAppleBrightness(value: Float) {
guard !self.isDummy else { guard !self.isDummy else {
return return
} }

View file

@ -377,7 +377,7 @@ class OtherDisplay: Display {
return intCodes return intCodes
} }
public func writeDDCValues(command: Command, value: UInt16) { func writeDDCValues(command: Command, value: UInt16) {
guard app.sleepID == 0, app.reconfigureID == 0, !self.readPrefAsBool(key: .forceSw), !self.readPrefAsBool(key: .unavailableDDC, for: command) else { guard app.sleepID == 0, app.reconfigureID == 0, !self.readPrefAsBool(key: .forceSw), !self.readPrefAsBool(key: .unavailableDDC, for: command) else {
return return
} }

View file

@ -8,9 +8,9 @@ let ARM64_DDC_DATA_ADDRESS: UInt8 = 0x51
class Arm64DDC: NSObject { class Arm64DDC: NSObject {
#if arch(arm64) #if arch(arm64)
public static let isArm64: Bool = true static let isArm64: Bool = true
#else #else
public static let isArm64: Bool = false static let isArm64: Bool = false
#endif #endif
static let MAX_MATCH_SCORE: Int = 20 static let MAX_MATCH_SCORE: Int = 20

View file

@ -5,7 +5,7 @@ import CoreGraphics
import os.log import os.log
class DisplayManager { class DisplayManager {
public static let shared = DisplayManager() static let shared = DisplayManager()
var displays: [Display] = [] var displays: [Display] = []
var audioControlTargetDisplays: [OtherDisplay] = [] var audioControlTargetDisplays: [OtherDisplay] = []
@ -177,6 +177,7 @@ class DisplayManager {
let isDummy: Bool = DisplayManager.isDummy(displayID: onlineDisplayID) let isDummy: Bool = DisplayManager.isDummy(displayID: onlineDisplayID)
let isVirtual: Bool = DisplayManager.isVirtual(displayID: onlineDisplayID) let isVirtual: Bool = DisplayManager.isVirtual(displayID: onlineDisplayID)
if !DEBUG_SW, DisplayManager.isAppleDisplay(displayID: onlineDisplayID) { // MARK: (point of interest for testing) if !DEBUG_SW, DisplayManager.isAppleDisplay(displayID: onlineDisplayID) { // MARK: (point of interest for testing)
let appleDisplay = AppleDisplay(id, name: name, vendorNumber: vendorNumber, modelNumber: modelNumber, serialNumber: serialNumber, isVirtual: isVirtual, isDummy: isDummy) let appleDisplay = AppleDisplay(id, name: name, vendorNumber: vendorNumber, modelNumber: modelNumber, serialNumber: serialNumber, isVirtual: isVirtual, isDummy: isDummy)
os_log("Apple display found - %{public}@", type: .info, "ID: \(appleDisplay.identifier), Name: \(appleDisplay.name) (Vendor: \(appleDisplay.vendorNumber ?? 0), Model: \(appleDisplay.modelNumber ?? 0))") os_log("Apple display found - %{public}@", type: .info, "ID: \(appleDisplay.identifier), Name: \(appleDisplay.name) (Vendor: \(appleDisplay.vendorNumber ?? 0), Model: \(appleDisplay.modelNumber ?? 0))")
self.addDisplay(display: appleDisplay) self.addDisplay(display: appleDisplay)
@ -549,6 +550,7 @@ class DisplayManager {
} }
} }
if let screen = getByDisplayID(displayID: displayID) { // MARK: This, and NSScreen+Extension.swift will not be needed when we drop MacOS 10 support. if let screen = getByDisplayID(displayID: displayID) { // MARK: This, and NSScreen+Extension.swift will not be needed when we drop MacOS 10 support.
if #available(macOS 10.15, *) { if #available(macOS 10.15, *) {
return screen.localizedName return screen.localizedName
} else { } else {

View file

@ -209,7 +209,7 @@ class SliderHandler {
} }
} }
public init(display: Display?, command: Command, title: String = "", position _: Int = 0) { init(display: Display?, command: Command, title: String = "", position _: Int = 0) {
self.command = command self.command = command
self.title = title self.title = title
let slider = SliderHandler.MCSlider(value: 0, minValue: 0, maxValue: 1, target: self, action: #selector(SliderHandler.valueChanged)) let slider = SliderHandler.MCSlider(value: 0, minValue: 0, maxValue: 1, target: self, action: #selector(SliderHandler.valueChanged))
@ -379,7 +379,7 @@ class SliderHandler {
slider.setDisplayHighlightItems(false) slider.setDisplayHighlightItems(false)
} }
if self.percentageBox == self.percentageBox { if self.percentageBox == self.percentageBox {
self.percentageBox?.stringValue = "" + String(Int(value * 100)) + "%" self.percentageBox?.stringValue = "\(String(format: "%.0f%%", Double(value) * 100))"
} }
} }
} }

View file

@ -67,7 +67,7 @@ class DisplaysPrefsViewController: NSViewController, SettingsPane, NSTableViewDa
self.displays.count self.displays.count
} }
public static func isImac() -> Bool { static func isImac() -> Bool {
let platformExpertDevice = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")) let platformExpertDevice = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"))
if let modelIdentifier = IORegistryEntryCreateCFProperty(platformExpertDevice, "model" as CFString, kCFAllocatorDefault, 0).takeRetainedValue() as? String { if let modelIdentifier = IORegistryEntryCreateCFProperty(platformExpertDevice, "model" as CFString, kCFAllocatorDefault, 0).takeRetainedValue() as? String {
return modelIdentifier.contains("iMac") return modelIdentifier.contains("iMac")
@ -75,14 +75,14 @@ class DisplaysPrefsViewController: NSViewController, SettingsPane, NSTableViewDa
return false return false
} }
public struct DisplayInfo { struct DisplayInfo {
var displayType = "" var displayType = ""
var displayImage = "" var displayImage = ""
var controlMethod = "" var controlMethod = ""
var controlStatus = "" var controlStatus = ""
} }
public static func getDisplayInfo(display: Display) -> DisplayInfo { static func getDisplayInfo(display: Display) -> DisplayInfo {
var displayType = NSLocalizedString("Other Display", comment: "Shown in the Display Settings") var displayType = NSLocalizedString("Other Display", comment: "Shown in the Display Settings")
var displayImage = "display.trianglebadge.exclamationmark" var displayImage = "display.trianglebadge.exclamationmark"
var controlMethod = NSLocalizedString("No Control", comment: "Shown in the Display Settings") + " ⚠️" var controlMethod = NSLocalizedString("No Control", comment: "Shown in the Display Settings") + " ⚠️"