Skip to content

Commit 64425ef

Browse files
Register screen capture permission explicitly
1 parent 1f556f4 commit 64425ef

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

OverflowBar/Services/PermissionManager.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ final class PermissionManager: ObservableObject {
2424

2525
func requestScreenRecording() {
2626
Task {
27-
// Enumerating shareable content is the supported macOS 15+ request
28-
// path and also registers this app in Privacy settings.
27+
// Explicitly ask WindowServer/TCC to register this bundle. Merely
28+
// enumerating SCShareableContent can return an empty result without
29+
// adding the app to the Screen Recording list on macOS 26.
30+
if !CGPreflightScreenCaptureAccess() {
31+
_ = CGRequestScreenCaptureAccess()
32+
}
2933
_ = try? await SCShareableContent.excludingDesktopWindows(false, onScreenWindowsOnly: false)
3034
refresh()
3135
logger.info("Screen recording granted after request: \(self.screenRecordingGranted, privacy: .public)")

0 commit comments

Comments
 (0)