Skip to content

Commit e6ccff4

Browse files
committed
🐛 Fix for builtin display
- Fixed builtin display check in preferences
1 parent 8f400c6 commit e6ccff4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

MonitorControl/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
129129
if let edid = ddc?.edid() {
130130
let name = Utils.getDisplayName(forEdid: edid)
131131

132-
let display = Display(id, name: name)
132+
let display = Display(id, name: name, isBuiltin: screen.isBuiltin)
133133

134134
let monitorSubMenu: NSMenu = asSubMenu ? NSMenu() : self.statusMenu
135135

MonitorControl/Display.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import os.log
66
class Display {
77
let identifier: CGDirectDisplayID
88
let name: String
9+
let isBuiltin: Bool
910
var isEnabled: Bool
1011
var isMuted: Bool = false
1112
var brightnessSliderHandler: SliderHandler?
@@ -16,11 +17,12 @@ class Display {
1617
private let prefs = UserDefaults.standard
1718
private var audioPlayer: AVAudioPlayer?
1819

19-
init(_ identifier: CGDirectDisplayID, name: String, isEnabled: Bool = true) {
20+
init(_ identifier: CGDirectDisplayID, name: String, isBuiltin: Bool, isEnabled: Bool = true) {
2021
self.identifier = identifier
2122
self.name = name
22-
self.isEnabled = isEnabled
23+
self.isEnabled = isBuiltin ? false : isEnabled
2324
self.ddc = DDC(for: identifier)
25+
self.isBuiltin = isBuiltin
2426
self.isMuted = self.getValue(for: .audioMuteScreenBlank) == 1
2527
}
2628

MonitorControl/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.5.2</string>
2121
<key>CFBundleVersion</key>
22-
<string>533</string>
22+
<string>560</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>

0 commit comments

Comments
 (0)