Skip to content

Keep the Bluetooth adapter pairable only while the panel is open - #8144

Closed
Chessing234 wants to merge 2 commits into
omacom:quattrofrom
Chessing234:fix/bluetooth-pairable-with-panel
Closed

Chessing234 wants to merge 2 commits into
omacom:quattrofrom
Chessing234:fix/bluetooth-pairable-with-panel

Conversation

@Chessing234

@Chessing234 Chessing234 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

The Bluetooth panel never wrote adapter.pairable. BlueZ defaults PairableTimeout=0, so the adapter stayed pairable forever after a visit to the panel. bt-agent.service already documents NoInputNoOutput as safe only while the panel is open and scanning.

The panel now sets pairable true while it is open and the adapter is powered, and false when the last panel closes, is destroyed, or Bluetooth is turned off. Multi-monitor popout handoff matches discovery: openSibling() leaves pairable alone so a panel still open on another monitor can keep pairing.

Node assertions in bluetooth-test.sh cover open / close / sibling / power-off / destruction. No live BlueZ adapter here.

Fixes #7889

bt-agent's NoInputNoOutput comment is only safe if Pairable follows the
panel, but the panel never wrote adapter.pairable. BlueZ defaults
PairableTimeout=0, so the adapter stayed pairable after close and
nearby devices could Just Works pair. Write pairable on the same
open/close/destruction paths as discovery, and leave it alone when a
sibling panel is still open on another monitor.
Copilot AI balanced review requested due to automatic review settings August 25, 2026 03:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restricts Bluetooth pairability to periods when a powered adapter’s panel is open.

Changes:

  • Synchronizes pairability with panel, power, and destruction events.
  • Handles multi-monitor sibling panels.
  • Adds lifecycle assertions and model tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
shell/plugins/panels/bluetooth/Panel.qml Manages adapter pairability throughout panel lifecycle.
shell/plugins/panels/bluetooth/Model.js Computes the desired pairable state.
test/shell.d/bluetooth-test.sh Tests pairability decisions and lifecycle wiring.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

setPairable(Model.wantedPairable(opened, enabled, siblingOpen))
}

onAdapterChanged: applyPairable()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch — a new bar instance with bar still null couldn't see the open sibling and wrote pairable false. we skip that write until bar is injected, then ask the open sibling to reassert.

@Chessing234

Copy link
Copy Markdown
Contributor Author

@dhh @ryanrhughes ready for review

Chessing234 added a commit to Chessing234/omarchy that referenced this pull request Sep 21, 2026
@Chessing234

Copy link
Copy Markdown
Contributor Author

folded into #12114 with the bluetooth alias/status work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bluetooth remains pairable after the Omarchy panel is closed

2 participants