Skip to content

Detect denied Accessibility access on macOS 15+ (fixes #48) - #51

Open
timokox wants to merge 1 commit into
bhaller:masterfrom
timokox:fix-accessibility-check-tahoe-upstream
Open

Detect denied Accessibility access on macOS 15+ (fixes #48)#51
timokox wants to merge 1 commit into
bhaller:masterfrom
timokox:fix-accessibility-check-tahoe-upstream

Conversation

@timokox

@timokox timokox commented May 23, 2026

Copy link
Copy Markdown

Fixes #48. Probably also explains a chunk of the other "v1.10 stopped working on Tahoe" reports.

Root cause

The macOS-15+ branch of the launch-time Accessibility check casts the result of AXIsProcessTrustedWithOptions() to void and moves on:

if (@available(macOS 15.0, *)) {
    NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:(id)kCFBooleanFalse, (id)kAXTrustedCheckOptionPrompt, nil];
    (void)AXIsProcessTrustedWithOptions((CFDictionaryRef)opts);   // result discarded
}
else if (!AXIsProcessTrusted()) {
    // critical alert + open Settings + terminate
}

The intent is clearly to register with TCC via the no-prompt variant so the app appears in System Settings without nagging on every launch — but the failure mode after major OS upgrades is bad:

  1. Tahoe 26.5 (or another upgrade that resets/re-prompts TCC).
  2. User has not yet re-granted (or actively denied) Accessibility for Jiggler.
  3. Jiggler launches normally, the menu-bar icon turns green when it thinks it is jiggling, but every CGEventPost is silently dropped because the process is not Accessibility-trusted on modern macOS.
  4. The Mac still goes to sleep / runs the screensaver.

That matches the user-visible symptom in #48 ("Jiggler appears to run … Mac still goes to sleep") exactly.

Fix

Unify the trust check: the 15+ branch now captures the boolean result of AXIsProcessTrustedWithOptions() (no-prompt behaviour preserved — we still pass kAXTrustedCheckOptionPrompt = false). Both version branches feed into the same if (!accessibilityTrusted) { … alert … open Settings … terminate; } block.

Wording of the alert is also touched:

  • "Security & Privacy" → "System Settings > Privacy & Security" (modern pane name)
  • "the mouse cursor" → "the mouse and keyboard" (keyboard events are synthesised in some modes too)

Verification

xcodebuild -configuration Debug buildBUILD SUCCEEDED, no warnings. Smoke-tested on macOS 26.4.1: my DerivedData build path is not Accessibility-trusted, so the new check correctly catches the denial and fires the alert + terminate (unified log shows NSAccessibility Request Receivedterminate: ~130 ms later). In production a user sees the alert and is deep-linked into the right Settings pane.

Repro path for testers

After installing this build, once: remove Jiggler from System Settings > Privacy & Security > Accessibility, then launch Jiggler. Should now show the alert and open Settings, instead of silently lying about jiggling.

The macOS-15+ branch of the launch-time Accessibility check was casting
the result of AXIsProcessTrustedWithOptions() to void and moving on.
That was deliberate (the no-prompt variant is used to register the app
with TCC without nagging on every launch), but it has a nasty failure
mode after major OS upgrades:

  - Tahoe 26.5 re-prompts for TCC permissions.
  - User has not yet re-granted (or actively denied) Accessibility.
  - Jiggler launches fine, the menu-bar icon turns green when it thinks
    it's jiggling, but every CGEventPost is silently dropped because
    the process is not Accessibility-trusted.
  - The Mac still goes to sleep / runs the screensaver.

That is exactly the symptom @Creativotech reported on issue bhaller#48 after
upgrading from 26.1 to 26.5.

Unify the trust check across versions: the 15+ branch now captures the
result of AXIsProcessTrustedWithOptions(), and the rest of the flow
(critical alert, deep-link to System Settings > Privacy & Security >
Accessibility, then terminate) is shared with the legacy 10.15-14
path.  Alert text is also updated from "Security & Privacy" to the
current "System Settings > Privacy & Security" pane wording, and from
"the mouse cursor" to "the mouse and keyboard" since keyboard events
are also synthesised in some jiggle modes.

Verified: builds clean, smoke-test on this machine correctly fires the
alert (the DerivedData build path is not Accessibility-trusted, so the
new code path runs).
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.

Jiggler v1.10 completely broken on macOS Tahoe 26.5 (25F71)

1 participant