From 36eeb43c4044d260e914aeb7d87e11ff2227090a Mon Sep 17 00:00:00 2001
From: waydabber <37590873+waydabber@users.noreply.github.com>
Date: Sat, 14 Aug 2021 18:24:45 +0200
Subject: [PATCH] Do not use DDC if it is disabled for the display and Software
Fallback is off.
---
MonitorControl/Info.plist | 2 +-
MonitorControl/Model/ExternalDisplay.swift | 10 ++++------
MonitorControlHelper/Info.plist | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/MonitorControl/Info.plist b/MonitorControl/Info.plist
index 3d70ece..8fd310e 100644
--- a/MonitorControl/Info.plist
+++ b/MonitorControl/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 2328
+ 2332
LSApplicationCategoryType
public.app-category.utilities
LSMinimumSystemVersion
diff --git a/MonitorControl/Model/ExternalDisplay.swift b/MonitorControl/Model/ExternalDisplay.swift
index f5df024..6cdd73e 100644
--- a/MonitorControl/Model/ExternalDisplay.swift
+++ b/MonitorControl/Model/ExternalDisplay.swift
@@ -125,10 +125,8 @@ class ExternalDisplay: Display {
let isAlreadySet = volumeOSDValue == self.getValue(for: .audioSpeakerVolume)
- if !isAlreadySet {
- guard self.writeDDCValues(command: .audioSpeakerVolume, value: volumeDDCValue) == true else {
- return
- }
+ guard self.writeDDCValues(command: .audioSpeakerVolume, value: volumeDDCValue) == true else {
+ return
}
if let muteValue = muteValue {
@@ -218,7 +216,7 @@ class ExternalDisplay: Display {
}
public func writeDDCValues(command: DDC.Command, value: UInt16, errorRecoveryWaitTime _: UInt32? = nil) -> Bool? {
- guard app.sleepID == 0, app.reconfigureID == 0 else {
+ guard app.sleepID == 0, app.reconfigureID == 0, !self.forceSw else {
return false
}
if Arm64DDCUtils.isArm64 {
@@ -239,7 +237,7 @@ class ExternalDisplay: Display {
func readDDCValues(for command: DDC.Command, tries: UInt, minReplyDelay delay: UInt64?) -> (current: UInt16, max: UInt16)? {
var values: (UInt16, UInt16)?
- guard app.sleepID == 0, app.reconfigureID == 0 else {
+ guard app.sleepID == 0, app.reconfigureID == 0, !self.forceSw else {
return values
}
if Arm64DDCUtils.isArm64 {
diff --git a/MonitorControlHelper/Info.plist b/MonitorControlHelper/Info.plist
index f0118ce..7e0e551 100644
--- a/MonitorControlHelper/Info.plist
+++ b/MonitorControlHelper/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 2328
+ 2332
LSApplicationCategoryType
public.app-category.utilities
LSBackgroundOnly