fix: restore setDisplayMediaRequestHandler with useSystemPicker

Electron requires setDisplayMediaRequestHandler for getDisplayMedia() to
work — removing it broke screen sharing entirely. Restored the handler
with useSystemPicker: true, which on macOS 15+ uses the native system
picker (honoring restrictOwnAudio), while Windows/Linux fall back to
the custom picker with the shareAudio toggle for echo control.
This commit is contained in:
Jannis Braun
2026-03-16 18:34:50 +01:00
parent 9ff3761640
commit bda7930e61
5 changed files with 379 additions and 4 deletions
+8
View File
@@ -50,6 +50,14 @@ contextBridge.exposeInMainWorld('backspace', {
ipcRenderer.on('deep-link', (_event, url) => callback(url));
},
// Screen share picker coordination
onScreenShareSources: (callback: (sources: unknown[]) => void) => {
ipcRenderer.on('screen-share-sources', (_event, sources) => callback(sources));
},
selectScreenSource: (sourceId: string | null, shareAudio?: boolean) => {
ipcRenderer.send('screen-share-selected', sourceId, shareAudio ?? true);
},
// Instance URL management
getInstanceUrl: () => ipcRenderer.invoke('get-instance-url'),
setInstanceUrl: (url: string) => ipcRenderer.invoke('set-instance-url', url),