Repository navigation
Keep bluetooth bar icon visible after adapter disappears - #12241
RushiChaganti wants to merge 1 commit into
Conversation
Automated AI review
Verified: within a running shell, the change does what it describes. Once a widget has seen an adapter, a later One gap remains in the scenario the PR targets, plus a smaller side effect. The latch resets whenever the widget is recreated, including after a reboot with Bluetooth off
A widget created while an adapter is present does latch at creation. The reset only matters when the adapter is absent at that moment. Impact: after a reboot with Bluetooth off, the PR's stated problem ("no UI way to turn Bluetooth back on") returns on the hardware it targets. The IPC Suggested change: derive "show the off state" from a signal that survives restarts, such as the presence of a Bluetooth rfkill switch (it stays registered while blocked; behavior on machines without a Bluetooth module would need checking). Alternatively, state in the PR and the code comment that the fix covers only the current session. A physically removed adapter now shows as "Turned Off"Once latched, every Impact: a misleading status and a switch that cannot succeed, lasting until the widget is recreated. Lower impact than the first finding. Suggested change: where possible, distinguish "no Bluetooth hardware" from "rfkill-disabled controller" (the rfkill signal above could serve both), or reset the latch when an enable attempt fails. Optional test improvement: the edited assertion in Comment wording: the new comment says BlueZ removes the adapter's D-Bus object while rfkill holds it blocked. BlueZ keeps soft-blocked adapters and reports them as powered off. The object disappears when the block powers the module off and the kernel drops the controller, after which BlueZ unregisters it. Wording along those lines would be more accurate. Review informationTest scope: source review of the pinned head against the merge-base, including AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for this, @RushiChaganti. I read it at 8e198d1 against The problem is real, and this fixes it for the current session only. Once this widget instance has seen an adapter, a null adapter keeps the icon, the switch and the "on" path, as described. But #12585 is the fix I'd put forward. It asks rfkill whether the radio is soft-blocked whenever BlueZ has no adapter, at startup as well as on every change. That covers a persisted block after a reboot, and it still hides the widget on a machine with no Bluetooth. #13204 is the smaller alternative, but it keys on whether a Bluetooth switch exists rather than whether it is blocked, so a stopped Second opinion: Codex at medium effort ranked them independently of my answer, but it can read this session, so its independence is not guaranteed. It reached the same order, #12585 first and #13204 second, and found the same reboot gap in this one. It added that #10749 leaves Next step: the maintainer chooses between the competing fixes, so this is waiting on them. |
|
Thank you for this, @RushiChaganti. #12585 fixes the same problem and also handles a case this one misses, as the review above explains, so this is closed in favour of it. If it does not cover your case, please say so there. Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent. |
The adapter disappears when Bluetooth is turned off, so this PR keeps the Bluetooth icon and toggle visible even when the adapter is temporarily unavailable.
Summary
Bluetooth.defaultAdapterto becomenull.adapterEverSeento keep the icon, toggle, and power action available after an adapter has been detected, treating anulladapter as the Bluetooth off state.Test Plan
./test/shell