From cc4905ecc3fa24657ebe3e05003c37b7c5025ba3 Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 11 Sep 2026 19:09:43 +0800 Subject: [PATCH] Fix Screen Recording permission request --- OverflowBar/Services/PermissionManager.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/OverflowBar/Services/PermissionManager.swift b/OverflowBar/Services/PermissionManager.swift index 1d86b77..0197955 100644 --- a/OverflowBar/Services/PermissionManager.swift +++ b/OverflowBar/Services/PermissionManager.swift @@ -20,15 +20,14 @@ final class PermissionManager: ObservableObject { } func requestScreenRecording() { - // Permission state can be stale when a local build replaces the - // release identity. Calling CGRequestScreenCaptureAccess repeatedly - // in that state reopens the macOS authorization sheet even when - // System Settings still shows OverflowBar as allowed. A permission - // button must only open the settings pane; capture itself remains - // gated by the read-only preflight check in MenuBarCaptureService. refresh() guard !screenRecordingGranted else { return } - openScreenRecordingSettings() + // Ask TCC first so supported app identities get the native prompt. + // Ad-hoc/background builds may not be promptable on macOS 26; in that + // case, open the exact pane so the user can add or enable this build. + _ = CGRequestScreenCaptureAccess() + refresh() + if !screenRecordingGranted { openScreenRecordingSettings() } } func openAccessibilitySettings() { open("x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility") }