mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
brightness: fix osd suppression
This commit is contained in:
@@ -25,6 +25,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
property int maxBrightness: 100
|
property int maxBrightness: 100
|
||||||
property bool brightnessInitialized: false
|
property bool brightnessInitialized: false
|
||||||
|
property bool suppressNextOsd: false
|
||||||
|
|
||||||
signal brightnessChanged
|
signal brightnessChanged
|
||||||
signal deviceSwitched
|
signal deviceSwitched
|
||||||
@@ -56,7 +57,12 @@ Singleton {
|
|||||||
newBrightness[device.id] = device.currentPercent
|
newBrightness[device.id] = device.currentPercent
|
||||||
deviceBrightness = newBrightness
|
deviceBrightness = newBrightness
|
||||||
|
|
||||||
if (!suppressSignal && oldValue !== device.currentPercent) {
|
const shouldSuppress = suppressSignal || suppressNextOsd
|
||||||
|
if (suppressNextOsd) {
|
||||||
|
suppressNextOsd = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!shouldSuppress && oldValue !== device.currentPercent) {
|
||||||
brightnessChanged()
|
brightnessChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,6 +125,10 @@ Singleton {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (suppressOsd) {
|
||||||
|
suppressNextOsd = true
|
||||||
|
}
|
||||||
|
|
||||||
DMSService.sendRequest("brightness.setBrightness", {
|
DMSService.sendRequest("brightness.setBrightness", {
|
||||||
"device": actualDevice,
|
"device": actualDevice,
|
||||||
"percent": clampedValue
|
"percent": clampedValue
|
||||||
@@ -531,7 +541,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onBrightnessDeviceUpdate(device) {
|
function onBrightnessDeviceUpdate(device) {
|
||||||
updateSingleDevice(device, true)
|
updateSingleDevice(device, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user