@@ -809,7 +809,14 @@ export class CodeWindow extends Disposable implements ICodeWindow {
809809
810810 // fullscreen gets special treatment
811811 if ( this . isFullScreen ) {
812- const display = screen . getDisplayMatching ( this . getBounds ( ) ) ;
812+ let display : Display | undefined ;
813+ try {
814+ display = screen . getDisplayMatching ( this . getBounds ( ) ) ;
815+ } catch ( error ) {
816+ // Electron has weird conditions under which it throws errors
817+ // e.g. https://github.com/microsoft/vscode/issues/100334 when
818+ // large numbers are passed in
819+ }
813820
814821 const defaultState = defaultWindowState ( ) ;
815822
@@ -976,8 +983,17 @@ export class CodeWindow extends Disposable implements ICodeWindow {
976983 }
977984
978985 // Multi Monitor (non-fullscreen): ensure window is within display bounds
979- const display = screen . getDisplayMatching ( { x : state . x , y : state . y , width : state . width , height : state . height } ) ;
980- const displayWorkingArea = this . getWorkingArea ( display ) ;
986+ let display : Display | undefined ;
987+ let displayWorkingArea : Rectangle | undefined ;
988+ try {
989+ display = screen . getDisplayMatching ( { x : state . x , y : state . y , width : state . width , height : state . height } ) ;
990+ displayWorkingArea = this . getWorkingArea ( display ) ;
991+ } catch ( error ) {
992+ // Electron has weird conditions under which it throws errors
993+ // e.g. https://github.com/microsoft/vscode/issues/100334 when
994+ // large numbers are passed in
995+ }
996+
981997 if (
982998 display && // we have a display matching the desired bounds
983999 displayWorkingArea && // we have valid working area bounds
0 commit comments