fix screenshare crash on OSX 14
This commit is contained in:
parent
64409372d9
commit
7ba9745582
1 changed files with 11 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { Session, DesktopCapturerSource, IpcMainEvent } from 'electron';
|
||||
import { desktopCapturer, ipcMain } from 'electron';
|
||||
import { desktopCapturer, ipcMain, systemPreferences } from 'electron';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import OS from '../ts/util/os/osMain';
|
||||
|
@ -28,6 +28,16 @@ export function updateDefaultSession(
|
|||
strictAssert(videoRequested, 'Not requesting video');
|
||||
strictAssert(!audioRequested, 'Requesting audio');
|
||||
|
||||
// macOS: if screen sharing is actively denied, Sonoma will crash
|
||||
// when we try to get the sources.
|
||||
if (
|
||||
OS.isMacOS() &&
|
||||
systemPreferences.getMediaAccessStatus('screen') === 'denied'
|
||||
) {
|
||||
callback({});
|
||||
return;
|
||||
}
|
||||
|
||||
const sources = await desktopCapturer.getSources({
|
||||
fetchWindowIcons: true,
|
||||
thumbnailSize: { height: 102, width: 184 },
|
||||
|
|
Loading…
Reference in a new issue