Repository navigation
fix(macos): prompt for accessibility access only once per launch - #148
StreamOfRon wants to merge 1 commit into
Conversation
The helper retried checkAccess() with prompt:true every 10s, so a helper whose grant hadn't stuck (adhoc signature, or grant applied to the top-level app instead of the helper) re-prompted forever. Prompt once, then poll silently so a later manual grant still takes effect.
|
| if hasPromptedForAccess { | ||
| return AXIsProcessTrusted() |
There was a problem hiding this comment.
Missing access becomes invisible
If access is granted to the top-level app instead of the Swift helper, the helper remains untrusted. Every retry now checks silently, so it waits without recording windows or explaining which executable needs access. The Python permission alert runs only once at startup. A one-time diagnostic naming the helper and the required Settings action would make this state easier to resolve without bringing back repeated prompts.
Knowledge Base Used:
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks @StreamOfRon — this is a clean, minimal fix for #147. Read through the diff: the one-shot
LGTM from my side; leaving the merge to a maintainer. Suggested order: #148 → #150 → #146 (see my note on #150 for why). |
Fixes #147.
The helper retried
checkAccess()with prompt:true every 10s, so a helper whose grant hadn't stuck (adhoc signature, or grant applied to the top-level app instead of the helper) re-prompted forever. This change prompts once per launch, then polls silently so a later manual grant still takes effect without restart.Notes for reviewers:
aw_watcher_window/macos.swiftonly (newhasPromptedForAccessflag + early silent return incheckAccess()).start()retry loop untouched;AXIsProcessTrusted()predates the macOS 12 deployment target, so no compat concerns.make build-swiftclean (no new warnings),pytest tests/78/78 pass.