From c658952ab7509c81912d7d378d97cb83fa7e4fe6 Mon Sep 17 00:00:00 2001
From: waydabber <37590873+waydabber@users.noreply.github.com>
Date: Thu, 12 Aug 2021 01:25:36 +0200
Subject: [PATCH] Fixed 'Fallback to software control' is not working properly
in conjunction with 'Change Brightness/Volume for all screens'.
---
MonitorControl/AppDelegate.swift | 4 ++--
MonitorControl/Info.plist | 2 +-
MonitorControlHelper/Info.plist | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/MonitorControl/AppDelegate.swift b/MonitorControl/AppDelegate.swift
index 673c634..b76f3eb 100644
--- a/MonitorControl/AppDelegate.swift
+++ b/MonitorControl/AppDelegate.swift
@@ -396,14 +396,14 @@ extension AppDelegate: MediaKeyTapDelegate {
}
let delay = isRepeat ? 0.05 : 0 // Introduce a small delay to handle the media key being held down
var isAnyDisplayInSwAfterBrightnessMode: Bool = false
- for display in affectedDisplays where (display as? ExternalDisplay)?.isSwBrightnessNotDefault() ?? false {
+ for display in affectedDisplays where ((display as? ExternalDisplay)?.isSwBrightnessNotDefault() ?? false) && !((display as? ExternalDisplay)?.isSw() ?? false) {
isAnyDisplayInSwAfterBrightnessMode = true
}
self.keyRepeatTimers[mediaKey] = Timer.scheduledTimer(withTimeInterval: delay, repeats: false, block: { _ in
for display in affectedDisplays where display.isEnabled && !display.isVirtual {
switch mediaKey {
case .brightnessUp:
- if !(isAnyDisplayInSwAfterBrightnessMode && !((display as? ExternalDisplay)?.isSwBrightnessNotDefault() ?? false)) {
+ if !(isAnyDisplayInSwAfterBrightnessMode && !(((display as? ExternalDisplay)?.isSwBrightnessNotDefault() ?? false) && !((display as? ExternalDisplay)?.isSw() ?? false))) {
display.stepBrightness(isUp: mediaKey == .brightnessUp, isSmallIncrement: isSmallIncrement)
}
case .brightnessDown:
diff --git a/MonitorControl/Info.plist b/MonitorControl/Info.plist
index 338259b..487c347 100644
--- a/MonitorControl/Info.plist
+++ b/MonitorControl/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 1864
+ 1868
LSApplicationCategoryType
public.app-category.utilities
LSMinimumSystemVersion
diff --git a/MonitorControlHelper/Info.plist b/MonitorControlHelper/Info.plist
index dac17bd..58eafc1 100644
--- a/MonitorControlHelper/Info.plist
+++ b/MonitorControlHelper/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 1864
+ 1868
LSApplicationCategoryType
public.app-category.utilities
LSBackgroundOnly