Skip to content

Commit

Permalink
New window opens behind existing windows (fix #149394) (#150530)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed May 27, 2022
1 parent 5c77ef5 commit 6682d2f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/vs/platform/windows/electron-main/window.ts
Expand Up @@ -307,7 +307,15 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this.setFullScreen(true);
}

if (!this._win.isVisible()) {
if (
!this._win.isVisible() ||
// TODO@electron: Required condition ever since https://github.com/electron/electron/pull/33536
// landed in Electron 17.4.2: calling `window.maximize()` on macOS will wrongly result in
// `window.isVisible()` to return `true` even though a different window might still be on top.
// As such, we also need to ask for `window.isFocused()` which on macOS will ask whether the
// window is a "key" window.
(isMacintosh && !this._win.isFocused())
) {
this._win.show(); // to reduce flicker from the default window size to maximize, we only show after maximize
}
mark('code/didMaximizeCodeWindow');
Expand Down Expand Up @@ -792,7 +800,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this.focus({ force: true });
this._win.webContents.openDevTools();
}

}, 10000)).schedule();
}

Expand Down

0 comments on commit 6682d2f

Please sign in to comment.