Fix: Scan for DDC displays when quick settings opens

The scan was keyed off this item becoming visible, but on a machine with no
backlight `visible` stays false until a scan has already found a DDC
display, so it never scanned at all. It now keys off the quick settings
panel opening, which still keeps the second-long I2C probe off shell
startup.
This commit is contained in:
Gabriel Brown
2026-09-14 14:36:39 -04:00
parent 39a2e8e9ca
commit 9156a7e05c
@@ -34,11 +34,23 @@ Item {
visible: root.rowCount > 0
implicitHeight: rows.implicitHeight
// Probing I2C takes on the order of a second, so it waits until the panel
// is actually on screen rather than running at shell startup. Monitors do
// not come and go, so once is enough.
onVisibleChanged: if (visible && !Brightness.scanned) Brightness.refresh()
Component.onCompleted: if (root.visible && !Brightness.scanned) Brightness.refresh()
// Probing I2C takes on the order of a second, so it waits until the quick
// settings panel is actually on screen rather than running at shell
// startup. Monitors do not come and go, so once is enough.
//
// The trigger is the panel opening, not this item becoming visible: on a
// machine with no backlight, `visible` stays false until a scan has found
// a DDC display, so keying the scan off it would never scan at all.
Connections {
target: ShellState
function onQuickSettingsOpenChanged(): void { root.scanIfOpen(); }
}
Component.onCompleted: root.scanIfOpen()
function scanIfOpen(): void {
if (ShellState.quickSettingsOpen && !Brightness.scanned)
Brightness.refresh();
}
// `-m` is the machine-readable form: name,class,current,percent,max
Process {