@@ -232,11 +232,9 @@ export class WindowsStateHandler extends Disposable {
232
232
const windowConfig = this . configurationService . getValue < IWindowSettings | undefined > ( 'window' ) ;
233
233
234
234
// Window state is not from a previous session: only allow fullscreen if we inherit it or user wants fullscreen
235
- // or to address a Electron issue on macOS (https://github.com/microsoft/vscode/issues/125122)
236
235
let allowFullscreen : boolean ;
237
236
if ( state . hasDefaultState ) {
238
- const configAllowsFullScreen = ! ! ( windowConfig ?. newWindowDimensions && [ 'fullscreen' , 'inherit' , 'offset' ] . indexOf ( windowConfig . newWindowDimensions ) >= 0 ) ;
239
- allowFullscreen = configAllowsFullScreen || ( isMacintosh && windowConfig ?. nativeFullScreen !== false ) ;
237
+ allowFullscreen = ! ! ( windowConfig ?. newWindowDimensions && [ 'fullscreen' , 'inherit' , 'offset' ] . indexOf ( windowConfig . newWindowDimensions ) >= 0 ) ;
240
238
}
241
239
242
240
// Window state is from a previous session: only allow fullscreen when we got updated or user wants to restore
@@ -339,22 +337,14 @@ export class WindowsStateHandler extends Disposable {
339
337
// Compute x/y based on display bounds
340
338
// Note: important to use Math.round() because Electron does not seem to be too happy about
341
339
// display coordinates that are not absolute numbers.
342
- let state : INewWindowState = defaultWindowState ( ) ;
340
+ let state = defaultWindowState ( ) ;
343
341
state . x = Math . round ( displayToUse . bounds . x + ( displayToUse . bounds . width / 2 ) - ( state . width ! / 2 ) ) ;
344
342
state . y = Math . round ( displayToUse . bounds . y + ( displayToUse . bounds . height / 2 ) - ( state . height ! / 2 ) ) ;
345
343
344
+ // Check for newWindowDimensions setting and adjust accordingly
346
345
const windowConfig = this . configurationService . getValue < IWindowSettings | undefined > ( 'window' ) ;
347
346
let ensureNoOverlap = true ;
348
-
349
- // TODO@electron macOS: if the current window is fullscreen and native fullscreen
350
- // is not disabled, always open a new window in fullscreen. This is a workaround
351
- // for regression https://github.com/microsoft/vscode/issues/125122
352
- if ( isMacintosh && windowConfig ?. nativeFullScreen !== false && lastActive ?. isFullScreen ) {
353
- state . mode = WindowMode . Fullscreen ;
354
- }
355
-
356
- // Adjust according to `newWindowDimensions` user setting
357
- else if ( windowConfig ?. newWindowDimensions ) {
347
+ if ( windowConfig ?. newWindowDimensions ) {
358
348
if ( windowConfig . newWindowDimensions === 'maximized' ) {
359
349
state . mode = WindowMode . Maximized ;
360
350
ensureNoOverlap = false ;
@@ -377,7 +367,7 @@ export class WindowsStateHandler extends Disposable {
377
367
state = this . ensureNoOverlap ( state ) ;
378
368
}
379
369
380
- state . hasDefaultState = true ; // flag as default state
370
+ ( state as INewWindowState ) . hasDefaultState = true ; // flag as default state
381
371
382
372
return state ;
383
373
}
0 commit comments