From 126e147afaa92f2a6fc4b23961f7d1da24bb87bc Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Sat, 28 Mar 2026 16:08:57 +0530 Subject: [PATCH] register app automaticaly --- apps/x/apps/main/forge.config.cjs | 24 ++++++++++++------------ apps/x/apps/main/src/ipc.ts | 4 ++-- apps/x/apps/main/src/main.ts | 11 ++++++++--- apps/x/apps/renderer/src/App.tsx | 2 +- apps/x/packages/shared/src/ipc.ts | 1 + 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/apps/x/apps/main/forge.config.cjs b/apps/x/apps/main/forge.config.cjs index 120c96b1..c79a8c43 100644 --- a/apps/x/apps/main/forge.config.cjs +++ b/apps/x/apps/main/forge.config.cjs @@ -11,18 +11,18 @@ module.exports = { icon: './icons/icon', // .icns extension added automatically appBundleId: 'com.rowboat.app', appCategoryType: 'public.app-category.productivity', - // osxSign: { - // batchCodesignCalls: true, - // optionsForFile: () => ({ - // entitlements: path.join(__dirname, 'entitlements.plist'), - // 'entitlements-inherit': path.join(__dirname, 'entitlements.plist'), - // }), - // }, - // osxNotarize: { - // appleId: process.env.APPLE_ID, - // appleIdPassword: process.env.APPLE_PASSWORD, - // teamId: process.env.APPLE_TEAM_ID - // }, + osxSign: { + batchCodesignCalls: true, + optionsForFile: () => ({ + entitlements: path.join(__dirname, 'entitlements.plist'), + 'entitlements-inherit': path.join(__dirname, 'entitlements.plist'), + }), + }, + osxNotarize: { + appleId: process.env.APPLE_ID, + appleIdPassword: process.env.APPLE_PASSWORD, + teamId: process.env.APPLE_TEAM_ID + }, // Since we bundle everything with esbuild, we don't need node_modules at all. // These settings prevent Forge's dependency walker (flora-colossus) from trying // to analyze/copy node_modules, which fails with pnpm's symlinked workspaces. diff --git a/apps/x/apps/main/src/ipc.ts b/apps/x/apps/main/src/ipc.ts index 2ab77c1e..eade8ab9 100644 --- a/apps/x/apps/main/src/ipc.ts +++ b/apps/x/apps/main/src/ipc.ts @@ -720,10 +720,10 @@ export function setupIpcHandlers() { return { success: false, error: 'Unknown format' }; }, 'meeting:checkScreenPermission': async () => { - if (process.platform !== 'darwin') return { granted: true }; + if (process.platform !== 'darwin') return { granted: true, status: 'non-darwin' }; const status = systemPreferences.getMediaAccessStatus('screen'); console.log('[meeting] Screen recording permission status:', status); - return { granted: status === 'granted' }; + return { granted: status === 'granted', status }; }, 'meeting:openScreenRecordingSettings': async () => { await shell.openExternal('x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture'); diff --git a/apps/x/apps/main/src/main.ts b/apps/x/apps/main/src/main.ts index d828f38d..b2c3cefd 100644 --- a/apps/x/apps/main/src/main.ts +++ b/apps/x/apps/main/src/main.ts @@ -129,13 +129,18 @@ function createWindow() { // Auto-approve display media requests and route system audio as loopback. // Electron requires a video source in the callback even if we only want audio. // We pass the first available screen source; the renderer discards the video track. + // We use cached sources to avoid calling desktopCapturer.getSources() every time, + // which on macOS Sequoia triggers a native permission popup on each call. + let cachedScreenSources: Electron.DesktopCapturerSource[] | null = null; session.defaultSession.setDisplayMediaRequestHandler(async (_request, callback) => { - const sources = await desktopCapturer.getSources({ types: ['screen'] }); - if (sources.length === 0) { + if (!cachedScreenSources) { + cachedScreenSources = await desktopCapturer.getSources({ types: ['screen'] }); + } + if (cachedScreenSources.length === 0) { callback({}); return; } - callback({ video: sources[0], audio: 'loopback' }); + callback({ video: cachedScreenSources[0], audio: 'loopback' }); }); // Show window when content is ready to prevent blank screen diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index 6cc127bd..20a1b3b6 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -3497,7 +3497,7 @@ function App() { // On macOS, check screen recording permission before starting if (isMac) { const result = await window.ipc.invoke('meeting:checkScreenPermission', null) - console.log('[meeting] Permission check result:', result) + console.log('[meeting] Permission check result:', result, 'raw status:', result.status) if (!result.granted) { setShowMeetingPermissions(true) return diff --git a/apps/x/packages/shared/src/ipc.ts b/apps/x/packages/shared/src/ipc.ts index 28718db3..7331f394 100644 --- a/apps/x/packages/shared/src/ipc.ts +++ b/apps/x/packages/shared/src/ipc.ts @@ -505,6 +505,7 @@ const ipcSchemas = { req: z.null(), res: z.object({ granted: z.boolean(), + status: z.string(), }), }, 'meeting:openScreenRecordingSettings': {