@@ -174,7 +174,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
174
174
this . windowState = state ;
175
175
this . logService . trace ( 'window#ctor: using window state' , state ) ;
176
176
177
- // in case we are maximized or fullscreen, only show later after the call to maximize/fullscreen (see below)
177
+ // In case we are maximized or fullscreen, only show later
178
+ // after the call to maximize/fullscreen (see below)
178
179
const isFullscreenOrMaximized = ( this . windowState . mode === WindowMode . Maximized || this . windowState . mode === WindowMode . Fullscreen ) ;
179
180
180
181
const windowSettings = this . configurationService . getValue < IWindowSettings | undefined > ( 'window' ) ;
@@ -187,7 +188,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
187
188
backgroundColor : this . themeMainService . getBackgroundColor ( ) ,
188
189
minWidth : WindowMinimumSize . WIDTH ,
189
190
minHeight : WindowMinimumSize . HEIGHT ,
190
- show : ! isFullscreenOrMaximized ,
191
+ show : ! isFullscreenOrMaximized , // reduce flicker by showing later
191
192
title : this . productService . nameLong ,
192
193
webPreferences : {
193
194
preload : FileAccess . asFileUri ( 'vs/base/parts/sandbox/electron-browser/preload.js' , require ) . fsPath ,
@@ -301,23 +302,20 @@ export class CodeWindow extends Disposable implements ICodeWindow {
301
302
302
303
if ( isFullscreenOrMaximized ) {
303
304
mark ( 'code/willMaximizeCodeWindow' ) ;
305
+
306
+ // this call may or may not show the window, depends
307
+ // on the platform: currently on Windows and Linux will
308
+ // show the window as active. To be on the safe side,
309
+ // we show the window at the end of this block.
304
310
this . _win . maximize ( ) ;
305
311
306
312
if ( this . windowState . mode === WindowMode . Fullscreen ) {
307
313
this . setFullScreen ( true ) ;
308
314
}
309
315
310
- if (
311
- ! this . _win . isVisible ( ) ||
312
- // TODO@electron : Required condition ever since https://github.com/electron/electron/pull/33536
313
- // landed in Electron 17.4.2: calling `window.maximize()` on macOS will wrongly result in
314
- // `window.isVisible()` to return `true` even though a different window might still be on top.
315
- // As such, we also need to ask for `window.isFocused()` which on macOS will ask whether the
316
- // window is a "key" window.
317
- ( isMacintosh && ! this . _win . isFocused ( ) )
318
- ) {
319
- this . _win . show ( ) ; // to reduce flicker from the default window size to maximize, we only show after maximize
320
- }
316
+ // to reduce flicker from the default window size
317
+ // to maximize or fullscreen, we only show after
318
+ this . _win . show ( ) ;
321
319
mark ( 'code/didMaximizeCodeWindow' ) ;
322
320
}
323
321
0 commit comments