Various fixes and updates for Sequoia - v4.3.2 (#1632) · MonitorControl/MonitorControl@0bcc6a3 · GitHub
Skip to content

Commit 0bcc6a3

Browse files
authored
Various fixes and updates for Sequoia - v4.3.2 (#1632)
1 parent f625dc1 commit 0bcc6a3

15 files changed

Lines changed: 171 additions & 170 deletions

File tree

‎MonitorControl.xcodeproj/project.pbxproj‎

Lines changed: 32 additions & 16 deletions

‎MonitorControl.xcodeproj/xcshareddata/xcschemes/MonitorControl.xcscheme‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1250"
3+
LastUpgradeVersion = "1610"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

‎MonitorControl/Enums/PrefKey.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ enum MenuIcon: Int {
194194
}
195195

196196
enum MenuItemStyle: Int {
197-
case text = 0
198-
case icon = 1
197+
case icon = 0
198+
case text = 1
199199
case hide = 2
200200
}
201201

‎MonitorControl/Info.plist‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>7052</string>
22+
<string>7104</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>
@@ -33,8 +33,8 @@
3333
<key>SUEnableJavaScript</key>
3434
<true/>
3535
<key>SUFeedURL</key>
36-
<string>https://monitorcontrol.app/appcast.xml</string>
36+
<string>https://monitorcontrol.app/appcast2.xml</string>
3737
<key>SUPublicEDKey</key>
38-
<string>KuISgz+2n2/qnP/Rom5nWYAp+Pru+U3UtnAlnUjj6Pw=</string>
38+
<string>ITSTMp8AypsLawojJ+UR3tm2mN18AFoNMvXf1G3t62s=</string>
3939
</dict>
4040
</plist>

‎MonitorControl/Model/AppleDisplay.swift‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ class AppleDisplay: Display {
2424
guard !self.isDummy else {
2525
return
2626
}
27-
self.displayQueue.sync {
27+
_ = self.displayQueue.sync {
2828
DisplayServicesSetBrightness(self.identifier, value)
29-
DisplayServicesBrightnessChanged(self.identifier, Double(value))
3029
}
3130
}
3231

‎MonitorControl/Support/AppDelegate.swift‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
6464

6565
@objc func quitClicked(_: AnyObject) {
6666
os_log("Quit clicked", type: .info)
67-
NSApplication.shared.terminate(self)
67+
menu.closeMenu()
68+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
69+
NSApplication.shared.terminate(self)
70+
}
6871
}
6972

7073
@objc func prefsClicked(_: AnyObject) {

‎MonitorControl/Support/Arm64DDC.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Arm64DDC: NSObject {
104104
}
105105
if !reply.isEmpty {
106106
usleep(readSleepTime ?? 50000)
107-
if IOAVServiceReadI2C(service, UInt32(ARM64_DDC_7BIT_ADDRESS), UInt32(dataAddress), &reply, UInt32(reply.count)) == 0 {
107+
if IOAVServiceReadI2C(service, UInt32(ARM64_DDC_7BIT_ADDRESS), 0, &reply, UInt32(reply.count)) == 0 {
108108
success = self.checksum(chk: 0x50, data: &reply, start: 0, end: reply.count - 2) == reply[reply.count - 1]
109109
}
110110
}

‎MonitorControl/Support/Bridging-Header.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ extern IOReturn IOAVServiceReadI2C(IOAVService service, uint32_t chipAddress, ui
1313
extern IOReturn IOAVServiceWriteI2C(IOAVService service, uint32_t chipAddress, uint32_t dataAddress, void* inputBuffer, uint32_t inputBufferSize);
1414
extern CFDictionaryRef CoreDisplay_DisplayCreateInfoDictionary(CGDirectDisplayID);
1515

16-
extern void DisplayServicesBrightnessChanged(CGDirectDisplayID display, double brightness);
1716
extern int DisplayServicesGetBrightness(CGDirectDisplayID display, float *brightness);
1817
extern int DisplayServicesSetBrightness(CGDirectDisplayID display, float brightness);
1918
extern int DisplayServicesGetLinearBrightness(CGDirectDisplayID display, float *brightness);
2019
extern int DisplayServicesSetLinearBrightness(CGDirectDisplayID display, float brightness);
2120

2221
extern void CGSServiceForDisplayNumber(CGDirectDisplayID display, io_service_t* service);
2322

23+
bool CGSIsHDREnabled(CGDirectDisplayID display) __attribute__((weak_import));
24+
bool CGSIsHDRSupported(CGDirectDisplayID display) __attribute__((weak_import));
25+
2426
@class NSString;
2527

2628
@protocol OSDUIHelperProtocol

‎MonitorControl/Support/DisplayManager.swift‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,15 +474,17 @@ class DisplayManager {
474474
}
475475

476476
static func isAppleDisplay(displayID: CGDirectDisplayID) -> Bool {
477+
if #available(macOS 15.0, *) {
478+
if CGDisplayVendorNumber(displayID) != 1552, CGSIsHDRSupported(displayID), CGSIsHDREnabled(displayID) {
479+
return CGDisplayIsBuiltin(displayID) != 0
480+
}
481+
}
477482
var brightness: Float = -1
478483
let ret = DisplayServicesGetBrightness(displayID, &brightness)
479484
if ret == 0, brightness >= 0 { // If brightness read appears to be successful using DisplayServices then it should be an Apple display
480485
return true
481486
}
482-
if CGDisplayIsBuiltin(displayID) != 0 { // If built-in display then it should be Apple (except for hackintosh notebooks...)
483-
return true
484-
}
485-
return false
487+
return CGDisplayIsBuiltin(displayID) != 0 // If built-in display, it should be Apple
486488
}
487489

488490
static func getByDisplayID(displayID: CGDirectDisplayID) -> NSScreen? {

‎MonitorControl/Support/MenuHandler.swift‎

Lines changed: 8 additions & 4 deletions

0 commit comments

Comments
 (0)