From e2009a62ac593ebdb7f01cdd297d3f0f35c0cea1 Mon Sep 17 00:00:00 2001
From: Istvan Toth <37590873+waydabber@users.noreply.github.com>
Date: Tue, 15 Mar 2022 11:53:28 +0100
Subject: [PATCH] Improved dummy detection for newer versions of BetterDummy
(#975)
---
MonitorControl/Info.plist | 2 +-
MonitorControl/Support/DisplayManager.swift | 8 ++++----
MonitorControlHelper/Info.plist | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MonitorControl/Info.plist b/MonitorControl/Info.plist
index 8e93f4b..cf9febe 100644
--- a/MonitorControl/Info.plist
+++ b/MonitorControl/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 7029
+ 7030
LSApplicationCategoryType
public.app-category.utilities
LSMinimumSystemVersion
diff --git a/MonitorControl/Support/DisplayManager.swift b/MonitorControl/Support/DisplayManager.swift
index b9d51df..b56dccb 100644
--- a/MonitorControl/Support/DisplayManager.swift
+++ b/MonitorControl/Support/DisplayManager.swift
@@ -399,13 +399,13 @@ class DisplayManager {
}
static func isDummy(displayID: CGDirectDisplayID) -> Bool {
+ let vendorNumber = CGDisplayVendorNumber(displayID)
let rawName = DisplayManager.getDisplayRawNameByID(displayID: displayID)
- var isDummy: Bool = false
- if rawName.lowercased().contains("dummy") {
+ if rawName.lowercased().contains("dummy") || (self.isVirtual(displayID: displayID) && vendorNumber == UInt32(0xF0F0)) {
os_log("NOTE: Display is a dummy!", type: .info)
- isDummy = true
+ return true
}
- return isDummy
+ return false
}
static func isVirtual(displayID: CGDirectDisplayID) -> Bool {
diff --git a/MonitorControlHelper/Info.plist b/MonitorControlHelper/Info.plist
index e825efa..f9fd355 100644
--- a/MonitorControlHelper/Info.plist
+++ b/MonitorControlHelper/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 7029
+ 7030
LSApplicationCategoryType
public.app-category.utilities
LSBackgroundOnly