Skip to content

Commit ef48d15

Browse files
authored
Fix display names on M1 Macs (MonitorControl#370)
1 parent 1c611b0 commit ef48d15

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

MonitorControl/AppDelegate.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
9191
self.clearDisplays()
9292

9393
for screen in NSScreen.screens {
94-
let name = screen.displayName ?? NSLocalizedString("Unknown", comment: "Unknown display name")
94+
let name: String
95+
if #available(OSX 10.15, *) {
96+
name = screen.localizedName
97+
} else {
98+
name = screen.displayName ?? NSLocalizedString("Unknown", comment: "Unknown display name")
99+
}
95100
let id = screen.displayID
96101
let vendorNumber = screen.vendorNumber
97102
let modelNumber = screen.modelNumber

0 commit comments

Comments
 (0)