From 9156a7e05c69cb0543bf145fb5810fdedf188350 Mon Sep 17 00:00:00 2001 From: Gabriel Brown Date: Mon, 14 Sep 2026 14:36:39 -0400 Subject: [PATCH] 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. --- .../quicksettings/BrightnessControl.qml | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/config/dot/quickshell/modules/quicksettings/BrightnessControl.qml b/config/dot/quickshell/modules/quicksettings/BrightnessControl.qml index bf70cef..ce038a1 100644 --- a/config/dot/quickshell/modules/quicksettings/BrightnessControl.qml +++ b/config/dot/quickshell/modules/quicksettings/BrightnessControl.qml @@ -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 {