Skip to content

Detect stale Accessibility permission and show re-grant dialog #162

@artginzburg

Description

@artginzburg

Problem

After updating MiddleClick, macOS may silently invalidate the Accessibility permission. AXIsProcessTrusted() can still return true (false positive), but actual event taps fail. Users see MiddleClick "not working" with no explanation.

This primarily affects users who build from source (ad-hoc signing changes the binary hash every time). Release builds signed with Developer ID should retain permissions across updates, but edge cases exist.

Proposed fix

After AXIsProcessTrusted() returns true, attempt CGEventTapCreate() as a secondary check. If it returns NULL, the permission is stale — show a dialog explaining the user needs to:

  1. Remove MiddleClick from System Settings > Privacy & Security > Accessibility
  2. Re-open MiddleClick to re-trigger the permission prompt

Alternatively, offer to run tccutil reset Accessibility art.ginzburg.MiddleClick (requires sudo).

Context

  • Apple has not fixed this as of macOS Tahoe 26. All similar apps (Karabiner, BetterTouchTool, Hammerspoon) handle it the same way: detection + user-facing instructions.
  • AXIsProcessTrusted() false positive is a known issue.
  • Current workaround is documented in docs/troubleshooting.md.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions