From ef48d15a75bd716eb8f2b34093c85725d60e70c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Tue, 6 Jul 2021 20:46:02 +0200 Subject: [PATCH] Fix display names on M1 Macs (#370) --- MonitorControl/AppDelegate.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MonitorControl/AppDelegate.swift b/MonitorControl/AppDelegate.swift index 65ce90f..fcee1db 100644 --- a/MonitorControl/AppDelegate.swift +++ b/MonitorControl/AppDelegate.swift @@ -91,7 +91,12 @@ class AppDelegate: NSObject, NSApplicationDelegate { self.clearDisplays() for screen in NSScreen.screens { - let name = screen.displayName ?? NSLocalizedString("Unknown", comment: "Unknown display name") + let name: String + if #available(OSX 10.15, *) { + name = screen.localizedName + } else { + name = screen.displayName ?? NSLocalizedString("Unknown", comment: "Unknown display name") + } let id = screen.displayID let vendorNumber = screen.vendorNumber let modelNumber = screen.modelNumber