Skip to content

Fix repeated permission prompts when screen recording is already authorized - #3

Open
luw2007 wants to merge 1 commit into
batu3384:mainfrom
luw2007:feature/permission-prompt-fix
Open

luw2007 wants to merge 1 commit into
batu3384:mainfrom
luw2007:feature/permission-prompt-fix

Conversation

@luw2007

@luw2007 luw2007 commented Sep 11, 2026

Copy link
Copy Markdown

Problem

On macOS 14+, CGPreflightScreenCaptureAccess() can return false for ad-hoc signed apps even when screen recording permission has been granted. When the ScreenCaptureKit probe returns an indeterminate (.unknown) result, the app was resetting its 'previously granted' evidence, causing repeated permission prompts on subsequent launches.

Fix

  • persistResolvedState: don't reset granted evidence on .unknown probe result, only on definitive .denied
  • resolveState: when probe returns .unknown but persisted previouslyGranted flag is true (or in-memory grant evidence exists), return .granted instead of .unknown

This prevents transient probe failures from triggering repeated permission dialogs when the user has already granted screen recording access.

CGPreflightScreenCaptureAccess() is unreliable on macOS 14+ for
ad-hoc signed apps, often returning false even when permission is
granted. When the ScreenCaptureKit probe returns an indeterminate
(.unknown) result, the app was resetting its 'previously granted'
evidence, causing repeated permission prompts on subsequent launches.

Fix:
- persistResolvedState: don't reset granted evidence on .unknown,
  only on definitive .denied
- resolveState: when probe returns .unknown but persisted
  'previouslyGranted' flag is true (or in-memory grant evidence
  exists), return .granted instead of .unknown

This prevents transient probe failures from triggering repeated
permission dialogs when the user has already granted screen recording
access.
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.

1 participant