File tree Expand file tree Collapse file tree
sources/code/main/windows Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ export default function createMainWindow(...flags:MainWindowFlags): BrowserWindo
547547 autoResize ( ) ;
548548 win . on ( "resize" , autoResize ) ;
549549 } ) ;
550- } else void sources . then ( sources => {
550+ } else sources . then ( sources => {
551551 let allowAudioSharing = false ;
552552 // FIXME: L10N
553553 if ( apiGuard . unixAudioSharing ) allowAudioSharing = dialog . showMessageBoxSync ( win , {
@@ -559,6 +559,11 @@ export default function createMainWindow(...flags:MainWindowFlags): BrowserWindo
559559 video : sources [ 0 ] ,
560560 ...( allowAudioSharing ? { audio : "loopback" } : { } )
561561 } ) ; else callback ( null as unknown as Electron . Streams ) ;
562+ } ) . catch ( ( error : unknown ) => {
563+ if ( error === "Failed to get sources." ) {
564+ console . error ( "[BUG] On Wayland, getting no sources might cause portal crash in Chrome." ) ;
565+ console . error ( " You won't be able to screen share until app restart." ) ;
566+ } else commonCatches . print ( error ) ;
562567 } ) ;
563568 } , { useSystemPicker : true } ) ;
564569
You can’t perform that action at this time.
0 commit comments