1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

brightness: fix osd suppression

This commit is contained in:
bbedward
2025-11-03 16:27:41 -05:00
parent 8504144c32
commit 43fbbc07f5

View File

@@ -25,6 +25,7 @@ Singleton {
}
property int maxBrightness: 100
property bool brightnessInitialized: false
property bool suppressNextOsd: false
signal brightnessChanged
signal deviceSwitched
@@ -56,7 +57,12 @@ Singleton {
newBrightness[device.id] = device.currentPercent
deviceBrightness = newBrightness
if (!suppressSignal && oldValue !== device.currentPercent) {
const shouldSuppress = suppressSignal || suppressNextOsd
if (suppressNextOsd) {
suppressNextOsd = false
}
if (!shouldSuppress && oldValue !== device.currentPercent) {
brightnessChanged()
}
}
@@ -119,6 +125,10 @@ Singleton {
return
}
if (suppressOsd) {
suppressNextOsd = true
}
DMSService.sendRequest("brightness.setBrightness", {
"device": actualDevice,
"percent": clampedValue
@@ -531,7 +541,7 @@ Singleton {
}
function onBrightnessDeviceUpdate(device) {
updateSingleDevice(device, true)
updateSingleDevice(device, false)
}
}