@@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details.
10
10
11
11
// Squirrel on windows starts the app with various flags as hooks to tell us when we've been installed/uninstalled etc.
12
12
import "./squirrelhooks.js" ;
13
- import { app , BrowserWindow , Menu , autoUpdater , dialog , type Input , type Event , session , protocol } from "electron" ;
13
+ import { app , BrowserWindow , Menu , autoUpdater , dialog , type Input , type Event , session , protocol , desktopCapturer } from "electron" ;
14
14
// eslint-disable-next-line n/file-extension-in-import
15
15
import * as Sentry from "@sentry/electron/main" ;
16
16
import AutoLaunch from "auto-launch" ;
@@ -555,9 +555,15 @@ app.on("ready", async () => {
555
555
webContentsHandler ( global . mainWindow . webContents ) ;
556
556
557
557
session . defaultSession . setDisplayMediaRequestHandler ( ( _ , callback ) => {
558
- global . mainWindow ?. webContents . send ( "openDesktopCapturerSourcePicker" ) ;
558
+ if ( process . env . XDG_SESSION_TYPE === "wayland" ) {
559
+ desktopCapturer . getSources ( { types : [ 'screen' , 'window' ] } ) . then ( ( sources ) => {
560
+ callback ( { video : sources [ 0 ] } )
561
+ } ) ;
562
+ } else {
563
+ global . mainWindow ?. webContents . send ( "openDesktopCapturerSourcePicker" ) ;
564
+ }
559
565
setDisplayMediaCallback ( callback ) ;
560
- } ) ;
566
+ } , { useSystemPicker : true } ) ; // Use Mac OS 15+ native picker
561
567
562
568
setupMediaAuth ( global . mainWindow ) ;
563
569
} ) ;
0 commit comments