Skip to content

gui: live Input Monitoring + Bluetooth permission status via a polling watcher #54

@AprilNEA

Description

@AprilNEA

Problem

The Settings → Permissions section queries Input Monitoring (IOHIDCheckAccess) and Bluetooth (CBManager.authorization) via FFI at render time, inside permissions_group. Two issues:

  1. Per-repaint cost: the FFI runs on every Settings render (each switch toggle, language change, appearance change), not just on open.
  2. Stale status: nothing re-renders Settings when IM/Bluetooth status changes, so a grant-and-return doesn't update the row until an unrelated repaint. Only Accessibility is live, because its dedicated watcher calls refresh_windows() on change.

The three rows sit in one group at inconsistent altitude (one watcher-pushed, two pull-on-render with no driver).

Proposal

Generalize the existing accessibility watcher (watchers/accessibility.rs) into a permissions watcher that, on each tick (~1.2 s), checks all three permissions and refresh_windows() on any change. Store all three in AppState (alongside accessibility_granted); settings.rs reads the cached fields instead of calling FFI per render.

Acceptance

  • Granting Input Monitoring / Bluetooth in System Settings updates the Settings row within ~1–2 s without any other interaction.
  • No permission FFI on the Settings render hot path.

Context: review of #45 (findings #8, #9). Pairs with the broader "permissions UX" work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions