From 3cfc40598abbe3d36f5235b9535234a2ab525459 Mon Sep 17 00:00:00 2001 From: waydabber <37590873+waydabber@users.noreply.github.com> Date: Sun, 19 Apr 2026 08:37:34 +0200 Subject: [PATCH] v4.3.4 (#1861) Some minor changes + UI compatibility setting for Tahoe so the project properly compiles using Xcode 26. --- MonitorControl.xcodeproj/project.pbxproj | 4 ++-- MonitorControl/Enums/Command.swift | 2 +- MonitorControl/Info.plist | 2 ++ MonitorControl/Model/AppleDisplay.swift | 4 ++-- MonitorControl/Model/OtherDisplay.swift | 2 +- MonitorControl/Support/Arm64DDC.swift | 4 ++-- MonitorControl/Support/DisplayManager.swift | 4 +++- MonitorControl/Support/SliderHandler.swift | 4 ++-- .../Preferences/DisplaysPrefsViewController.swift | 6 +++--- 9 files changed, 18 insertions(+), 14 deletions(-) diff --git a/MonitorControl.xcodeproj/project.pbxproj b/MonitorControl.xcodeproj/project.pbxproj index 0583586..3ae92ca 100644 --- a/MonitorControl.xcodeproj/project.pbxproj +++ b/MonitorControl.xcodeproj/project.pbxproj @@ -881,7 +881,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 4.3.2; + MARKETING_VERSION = 4.3.4; PRODUCT_BUNDLE_IDENTIFIER = app.monitorcontrol.MonitorControl; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -918,7 +918,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 4.3.2; + MARKETING_VERSION = 4.3.4; PRODUCT_BUNDLE_IDENTIFIER = app.monitorcontrol.MonitorControl; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/MonitorControl/Enums/Command.swift b/MonitorControl/Enums/Command.swift index d6d1b7c..d374094 100644 --- a/MonitorControl/Enums/Command.swift +++ b/MonitorControl/Enums/Command.swift @@ -168,5 +168,5 @@ enum Command: UInt8 { case bottomLeftScreenPurity = 0xEA case bottomRightScreenPurity = 0xEB - public static let brightness = luminance + static let brightness = luminance } diff --git a/MonitorControl/Info.plist b/MonitorControl/Info.plist index 69810af..79873fe 100644 --- a/MonitorControl/Info.plist +++ b/MonitorControl/Info.plist @@ -36,5 +36,7 @@ https://monitorcontrol.app/appcast2.xml SUPublicEDKey ITSTMp8AypsLawojJ+UR3tm2mN18AFoNMvXf1G3t62s= + UIDesignRequiresCompatibility + diff --git a/MonitorControl/Model/AppleDisplay.swift b/MonitorControl/Model/AppleDisplay.swift index d49eae4..8c7dff6 100644 --- a/MonitorControl/Model/AppleDisplay.swift +++ b/MonitorControl/Model/AppleDisplay.swift @@ -11,7 +11,7 @@ class AppleDisplay: Display { 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 { return 1 } @@ -20,7 +20,7 @@ class AppleDisplay: Display { return brightness } - public func setAppleBrightness(value: Float) { + func setAppleBrightness(value: Float) { guard !self.isDummy else { return } diff --git a/MonitorControl/Model/OtherDisplay.swift b/MonitorControl/Model/OtherDisplay.swift index d920990..7c579c4 100644 --- a/MonitorControl/Model/OtherDisplay.swift +++ b/MonitorControl/Model/OtherDisplay.swift @@ -377,7 +377,7 @@ class OtherDisplay: Display { 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 { return } diff --git a/MonitorControl/Support/Arm64DDC.swift b/MonitorControl/Support/Arm64DDC.swift index 2ec0425..e8d1495 100644 --- a/MonitorControl/Support/Arm64DDC.swift +++ b/MonitorControl/Support/Arm64DDC.swift @@ -8,9 +8,9 @@ let ARM64_DDC_DATA_ADDRESS: UInt8 = 0x51 class Arm64DDC: NSObject { #if arch(arm64) - public static let isArm64: Bool = true + static let isArm64: Bool = true #else - public static let isArm64: Bool = false + static let isArm64: Bool = false #endif static let MAX_MATCH_SCORE: Int = 20 diff --git a/MonitorControl/Support/DisplayManager.swift b/MonitorControl/Support/DisplayManager.swift index f53d5bb..00a4627 100644 --- a/MonitorControl/Support/DisplayManager.swift +++ b/MonitorControl/Support/DisplayManager.swift @@ -5,7 +5,7 @@ import CoreGraphics import os.log class DisplayManager { - public static let shared = DisplayManager() + static let shared = DisplayManager() var displays: [Display] = [] var audioControlTargetDisplays: [OtherDisplay] = [] @@ -177,6 +177,7 @@ class DisplayManager { let isDummy: Bool = DisplayManager.isDummy(displayID: onlineDisplayID) let isVirtual: Bool = DisplayManager.isVirtual(displayID: onlineDisplayID) 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) 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) @@ -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 #available(macOS 10.15, *) { return screen.localizedName } else { diff --git a/MonitorControl/Support/SliderHandler.swift b/MonitorControl/Support/SliderHandler.swift index 1d7d20e..de28e90 100644 --- a/MonitorControl/Support/SliderHandler.swift +++ b/MonitorControl/Support/SliderHandler.swift @@ -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.title = title 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) } if self.percentageBox == self.percentageBox { - self.percentageBox?.stringValue = "" + String(Int(value * 100)) + "%" + self.percentageBox?.stringValue = "\(String(format: "%.0f%%", Double(value) * 100))" } } } diff --git a/MonitorControl/View Controllers/Preferences/DisplaysPrefsViewController.swift b/MonitorControl/View Controllers/Preferences/DisplaysPrefsViewController.swift index 7896b3a..0a8384d 100644 --- a/MonitorControl/View Controllers/Preferences/DisplaysPrefsViewController.swift +++ b/MonitorControl/View Controllers/Preferences/DisplaysPrefsViewController.swift @@ -67,7 +67,7 @@ class DisplaysPrefsViewController: NSViewController, SettingsPane, NSTableViewDa self.displays.count } - public static func isImac() -> Bool { + static func isImac() -> Bool { let platformExpertDevice = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")) if let modelIdentifier = IORegistryEntryCreateCFProperty(platformExpertDevice, "model" as CFString, kCFAllocatorDefault, 0).takeRetainedValue() as? String { return modelIdentifier.contains("iMac") @@ -75,14 +75,14 @@ class DisplaysPrefsViewController: NSViewController, SettingsPane, NSTableViewDa return false } - public struct DisplayInfo { + struct DisplayInfo { var displayType = "" var displayImage = "" var controlMethod = "" 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 displayImage = "display.trianglebadge.exclamationmark" var controlMethod = NSLocalizedString("No Control", comment: "Shown in the Display Settings") + " ⚠️"