Skip to content

Commit e2009a6

Browse files
authored
Improved dummy detection for newer versions of BetterDummy (MonitorControl#975)
1 parent b07d762 commit e2009a6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>7029</string>
22+
<string>7030</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>

MonitorControl/Support/DisplayManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ class DisplayManager {
399399
}
400400

401401
static func isDummy(displayID: CGDirectDisplayID) -> Bool {
402+
let vendorNumber = CGDisplayVendorNumber(displayID)
402403
let rawName = DisplayManager.getDisplayRawNameByID(displayID: displayID)
403-
var isDummy: Bool = false
404-
if rawName.lowercased().contains("dummy") {
404+
if rawName.lowercased().contains("dummy") || (self.isVirtual(displayID: displayID) && vendorNumber == UInt32(0xF0F0)) {
405405
os_log("NOTE: Display is a dummy!", type: .info)
406-
isDummy = true
406+
return true
407407
}
408-
return isDummy
408+
return false
409409
}
410410

411411
static func isVirtual(displayID: CGDirectDisplayID) -> Bool {

MonitorControlHelper/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>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>7029</string>
22+
<string>7030</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSBackgroundOnly</key>

0 commit comments

Comments
 (0)