summaryrefslogtreecommitdiffstats
path: root/osdep/macOS_swift_extensions.swift
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/macOS_swift_extensions.swift')
-rw-r--r--osdep/macOS_swift_extensions.swift6
1 files changed, 5 insertions, 1 deletions
diff --git a/osdep/macOS_swift_extensions.swift b/osdep/macOS_swift_extensions.swift
index 7929d48f9a..1e30cf4df7 100644
--- a/osdep/macOS_swift_extensions.swift
+++ b/osdep/macOS_swift_extensions.swift
@@ -17,11 +17,15 @@
import Cocoa
+extension NSDeviceDescriptionKey {
+ static let screenNumber = NSDeviceDescriptionKey("NSScreenNumber")
+}
+
extension NSScreen {
public var displayID: CGDirectDisplayID {
get {
- return deviceDescription["NSScreenNumber"] as? CGDirectDisplayID ?? 0
+ return deviceDescription[.screenNumber] as? CGDirectDisplayID ?? 0
}
}