mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
fix screenshare crash on OSX 14
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user