diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-15 10:06:49 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-15 10:06:49 +0200 |
| commit | f43f31a8efabcf160d6897191f99d173aa9f5c64 (patch) | |
| tree | a01c4426bc80c8e3e763ec7aa34a513b0b4424af /desktop/modules | |
| parent | 25e28ce76d1fdfbca56ac0a54bb873510e5c029d (diff) | |
| download | quickshell-f43f31a8efabcf160d6897191f99d173aa9f5c64.tar.gz quickshell-f43f31a8efabcf160d6897191f99d173aa9f5c64.zip | |
fix(desktop): stop bluetooth and wifi scans after 60s
Neither scan property self-terminates. BlueZ discovery runs until
StartDiscovery is stopped, and the NetworkManager scanner repeats until
disabled; the docs for both say as much and give no timeout or interval
property. The scan button was the only writer of either property, and
closing the drawer destroys the page without touching them, so a scan
started and forgotten kept the radio busy for the rest of the session.
Continuous wifi scanning also costs throughput on the connected link.
Each page gets a Timer bound to the scan property rather than started by
the button. Binding it that way means a manual stop cancels the clock,
and reopening the page on a scan still running from an earlier visit
re-arms a fresh 60s instead of leaving it running forever.
Verified both files parse: the desktop shell hot-reloaded without
dropping its process. The timeout firing at 60s is not verified here,
since it needs a real scan on the radio.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A7ThHHh5iTYbVfp3rNAkw2
Diffstat (limited to 'desktop/modules')
| -rw-r--r-- | desktop/modules/bluetooth/BluetoothPage.qml | 11 | ||||
| -rw-r--r-- | desktop/modules/network/NetworkPage.qml | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/desktop/modules/bluetooth/BluetoothPage.qml b/desktop/modules/bluetooth/BluetoothPage.qml index b47c506..5bfdc0b 100644 --- a/desktop/modules/bluetooth/BluetoothPage.qml +++ b/desktop/modules/bluetooth/BluetoothPage.qml @@ -82,6 +82,17 @@ Column { text: page.bt.adapter && page.bt.adapter.discovering ? "Stop scan" : "Scan" onClicked: if (page.bt.adapter) page.bt.adapter.discovering = !page.bt.adapter.discovering } + + // BlueZ discovery runs until stopped, and closing the drawer does not + // stop it, so a forgotten scan keeps the radio busy for the session. + // Bound to the property rather than started by the button: a manual + // stop cancels the clock, and reopening the page re-arms a fresh 60s + // on a scan still running from before. + Timer { + interval: 60000 + running: page.bt.adapter ? page.bt.adapter.discovering : false + onTriggered: if (page.bt.adapter) page.bt.adapter.discovering = false + } } // --- Connected --- diff --git a/desktop/modules/network/NetworkPage.qml b/desktop/modules/network/NetworkPage.qml index 975e68c..3749688 100644 --- a/desktop/modules/network/NetworkPage.qml +++ b/desktop/modules/network/NetworkPage.qml @@ -127,6 +127,15 @@ Column { text: page.net.wifiDevice && page.net.wifiDevice.scannerEnabled ? "Scanning…" : "Scan" onClicked: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = !page.net.wifiDevice.scannerEnabled } + + // The scanner repeats until disabled, and closing the drawer does not + // disable it. A continuous scan also costs throughput on the connected + // link. See the matching timer in BluetoothPage. + Timer { + interval: 60000 + running: page.net.wifiDevice ? page.net.wifiDevice.scannerEnabled : false + onTriggered: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = false + } } Repeater { |
