Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix: improve screen recording permission UX across meetings and integrations

Gabriel Stein2d41753e3acf
diff --git a/preload.js b/preload.js
index 37b009ea9..960627288 100644
--- a/preload.js
+++ b/preload.js
@@ -354,6 +354,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
openMicrophoneSettings: () => ipcRenderer.invoke("open-microphone-settings"),
openSoundInputSettings: () => ipcRenderer.invoke("open-sound-input-settings"),
openAccessibilitySettings: () => ipcRenderer.invoke("open-accessibility-settings"),
+ openScreenRecordingSettings: () => ipcRenderer.invoke("open-screen-recording-settings"),
toggleMediaPlayback: () => ipcRenderer.invoke("toggle-media-playback"),
pauseMediaPlayback: () => ipcRenderer.invoke("pause-media-playback"),
resumeMediaPlayback: () => ipcRenderer.invoke("resume-media-playback"),
diff --git a/src/components/IntegrationsView.tsx b/src/components/IntegrationsView.tsx
index c175d129d..240852306 100644
--- a/src/components/IntegrationsView.tsx
+++ b/src/components/IntegrationsView.tsx
@@ -53,13 +53,6 @@ export default function IntegrationsView() {
await startOAuth();
}, [screenRecording.isMacOS, screenRecording.granted, startOAuth]);
- const handleGrantAndConnect = useCallback(async () => {
- const wasGranted = await screenRecording.request();
- if (wasGranted) {
- await startOAuth();
- }
- }, [screenRecording, startOAuth]);
-
const handleDisconnect = useCallback(
async (email: string) => {
if (!window.confirm(t("integrations.googleCalendar.disconnectConfirm", { email }))) return;
@@ -185,8 +178,8 @@ export default function IntegrationsView() {
onOpenChange={setShowPermissionDialog}
title={t("integrations.googleCalendar.screenRecordingRequired")}
description={t("integrations.googleCalendar.screenRecordingDescription")}
- confirmText={t("integrations.googleCalendar.grantPermission")}
- onConfirm={handleGrantAndConnect}
+ confirmText={t("integrations.googleCalendar.openSettings")}
+ onConfirm={screenRecording.openSettings}
/>
</div>
);
diff --git a/src/components/UpcomingMeetings.tsx b/src/components/UpcomingMeetings.tsx
index 6b6d5dd8f..0270c88ae 100644
--- a/src/components/UpcomingMeetings.tsx
+++ b/src/components/UpcomingMeetings.tsx
@@ -111,10 +111,10 @@ export default function UpcomingMeetings({ events, isLoading }: UpcomingMeetings
<Button
size="sm"
variant="outline"
- onClick={screenRecording.request}
+ onClick={screenRecording.openSettings}
className="text-xs h-7"
>
- {t("upcoming.enablePermission")}
+ {t("upcoming.openSettings")}
</Button>
</>
) : (
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index f19fc5fc5..24679d858 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -1836,6 +1836,8 @@ class IPCHandlers {
sound: "x-apple.systempreferences:com.apple.preference.sound?input",
accessibility:
"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility",
+ screenRecording:
+ "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",
},
win32: {
microphone: "ms-settings:privacy-microphone",
@@ -1874,6 +1876,7 @@ class IPCHandlers {
ipcMain.handle("open-microphone-settings", () => openSystemSettings("microphone"));
ipcMain.handle("open-sound-input-settings", () => openSystemSettings("sound"));
ipcMain.handle("open-accessibility-settings", () => openSystemSettings("accessibility"));
+ ipcMain.handle("open-screen-recording-settings", () => openSystemSettings("screenRecording"));
ipcMain.handle("toggle-media-playback", () => {
const mediaPlayer = require("./mediaPlayer");
diff --git a/src/hooks/useScreenRecordingPermission.ts b/src/hooks/useScreenRecordingPermission.ts
index b566f37f1..287ce4f99 100644
--- a/src/hooks/useScreenRecordingPermission.ts
+++ b/src/hooks/useScreenRecordingPermission.ts
@@ -1,17 +1,40 @@
-import { useState, useCallback, useEffect } from "react";
+import { useState, useCallback, useEffect, useRef } from "react";
import { getCachedPlatform } from "../utils/platform";
export function useScreenRecordingPermission() {
const isMacOS = getCachedPlatform() === "darwin";
const [granted, setGranted] = useState(!isMacOS);
+ const checkingRef = useRef(false);
- useEffect(() => {
- if (!isMacOS) return;
- window.electronAPI?.checkScreenRecordingAccess?.().then((result) => {
+ const check = useCallback(async () => {
+ if (!isMacOS || checkingRef.current) return;
+ checkingRef.current = true;
+ try {
+ const result = await window.electronAPI?.checkScreenRecordingAccess?.();
setGranted(result?.granted ?? false);
- });
+ } finally {
+ checkingRef.current = false;
+ }
}, [isMacOS]);
+ // Check on mount
+ useEffect(() => {
+ check();
+ }, [check]);
+
+ // Re-check when the window regains focus (user may have just toggled it in System Settings)
+ useEffect(() => {
+ if (!isMacOS) return;
+ const handleFocus = () => check();
+ window.addEventListener("focus", handleFocus);
+ return () => window.removeEventListener("focus", handleFocus);
+ }, [isMacOS, check]);
+
+ const openSettings = useCallback(async () => {
+ await window.electronAPI?.openScreenRecordingSettings?.();
+ }, []);
+
+ // Trigger the native macOS permission prompt via getDisplayMedia (used in onboarding)
const request = useCallback(async (): Promise<boolean> => {
if (!isMacOS) return true;
try {
@@ -24,5 +47,5 @@ export function useScreenRecordingPermission() {
}
}, [isMacOS]);
- return { granted, request, isMacOS };
+ return { granted, request, openSettings, check, isMacOS };
}
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index fe3f12236..5b75cd0ed 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -159,8 +159,8 @@
"testAndGrant": "Test & Grant",
"requiredForApp": "Required for OpenWhispr to work",
"microphoneRequired": "Microphone access required",
- "screenRecordingTitle": "Screen & Audio Recording",
- "screenRecordingDescription": "Required only for meeting transcription. You can enable this later in Settings.",
+ "screenRecordingTitle": "Screen Recording",
+ "screenRecordingDescription": "Needed to capture meeting audio. You can enable this later in Settings.",
"optional": "Optional"
},
"transcription": {
@@ -549,8 +549,8 @@
"now": "Now",
"join": "Join",
"untitledEvent": "Untitled event",
- "screenRecordingRequired": "Enable Screen & Audio Recording to use meeting transcription.",
- "enablePermission": "Enable Permission"
+ "screenRecordingRequired": "Screen Recording permission is needed to capture meeting audio.",
+ "openSettings": "Open System Settings"
},
"cleanupPrompt": "Cleanup",
"developerSection": {
@@ -1734,9 +1734,9 @@
"disconnect": "Disconnect",
"disconnectConfirm": "Disconnect {{email}}?",
"disconnectDescription": "Meeting notes will no longer be recorded from this calendar.",
- "screenRecordingRequired": "Screen & Audio Recording Required",
- "screenRecordingDescription": "Meeting transcription requires the Screen & Audio Recording permission to capture meeting audio. Grant the permission to continue.",
- "grantPermission": "Grant Permission"
+ "screenRecordingRequired": "Screen Recording Permission Required",
+ "screenRecordingDescription": "To transcribe meetings, OpenWhispr needs the Screen Recording permission to capture audio from other apps. You'll be taken to System Settings to enable it.",
+ "openSettings": "Open System Settings"
},
"plan": {
"title": "Your Plan",
@@ -1758,8 +1758,8 @@
"now": "Now",
"join": "Join",
"untitledEvent": "Untitled Event",
- "screenRecordingRequired": "Enable Screen & Audio Recording to use meeting transcription.",
- "enablePermission": "Enable Permission"
+ "screenRecordingRequired": "Screen Recording permission is needed to capture meeting audio.",
+ "openSettings": "Open System Settings"
},
"notesView": {
"searchPlaceholder": "Search notes…",
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 52cc9eae7..7e2981dbf 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -706,6 +706,7 @@ declare global {
openMicrophoneSettings?: () => Promise<{ success: boolean; error?: string }>;
openSoundInputSettings?: () => Promise<{ success: boolean; error?: string }>;
openAccessibilitySettings?: () => Promise<{ success: boolean; error?: string }>;
+ openScreenRecordingSettings?: () => Promise<{ success: boolean; error?: string }>;
toggleMediaPlayback?: () => Promise<boolean>;
pauseMediaPlayback?: () => Promise<boolean>;
resumeMediaPlayback?: () => Promise<boolean>;