Fix brightness slider h/l bouncing to zero
This commit is contained in:
@@ -327,12 +327,17 @@ Item {
|
|||||||
Process {
|
Process {
|
||||||
id: setBrightnessProc
|
id: setBrightnessProc
|
||||||
stdout: StdioCollector { waitForEnd: true }
|
stdout: StdioCollector { waitForEnd: true }
|
||||||
|
// Do NOT call refresh() after a brightness set completes. The local
|
||||||
|
// brightnessPercent we just wrote is authoritative; re-reading via
|
||||||
|
// `omarchy-brightness-display` races the hardware/driver and can
|
||||||
|
// return an empty string, which the parser then coerces to 0 —
|
||||||
|
// visible as a "bounce to zero" after h/l keypresses. External
|
||||||
|
// brightness changes are still picked up by the 5s periodic refresh,
|
||||||
|
// the open-time refresh, and Component.onCompleted.
|
||||||
onRunningChanged: {
|
onRunningChanged: {
|
||||||
if (running) return
|
if (running) return
|
||||||
if (root.brightnessSetQueued) {
|
if (root.brightnessSetQueued) {
|
||||||
root.setBrightness(root.pendingBrightnessPercent)
|
root.setBrightness(root.pendingBrightnessPercent)
|
||||||
} else {
|
|
||||||
root.refresh()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user