You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: correct two bugs in post-grant screen recording detection
Bug 1 (introduced in previous commit): refreshAsync() was writing
screenCaptureGrantedLive = CGPreflightScreenCaptureAccess()
every 3 seconds. On macOS 15+, CGPreflightScreenCaptureAccess() is cached
to the process's initial TCC state and won't return true after a mid-session
grant. This meant the poll was overwriting any confirmed grant back to false
on the next tick, so the UI would never stick at 'Granted' even after the
one-shot SCShareableContent check had correctly detected it.
Fix: only advance screenCaptureGrantedLive from false → true; never downgrade
it. Permission revocations only take effect after an app restart, so a false
result from CGPreflightScreenCaptureAccess() can only be stale — not correct.
Bug 2 (pre-existing): openScreenCaptureSettings() scheduled the one-shot
SCShareableContent live check 3 seconds after the user clicked 'Grant…',
not 3 seconds after they returned from System Settings. Most users take
longer than 3 seconds to navigate the privacy page, so the check fired
mid-interaction and either re-triggered the TCC prompt (if not granted yet)
or got a false negative (System Settings still open).
Fix: replace the DispatchQueue.asyncAfter timer with an
NSWorkspace.didDeactivateApplicationNotification observer keyed on
com.apple.systempreferences. The one-shot check now fires exactly when the
user leaves System Settings — guaranteed to be after their interaction —
and the observer removes itself immediately after firing.
Additional: added pendingScreenCaptureCheck and systemPrefsObserver stored
properties; updated screenCaptureGrantedLive comment.
https://claude.ai/code/session_01XVfXe31wxQrYWMnQaTpAcy
0 commit comments