Skip to content

Commit 6682d2f

Browse files
authored
New window opens behind existing windows (fix #149394) (#150530)
1 parent 5c77ef5 commit 6682d2f

File tree

1 file changed

+9
-2
lines changed
  • src/vs/platform/windows/electron-main

1 file changed

+9
-2
lines changed

src/vs/platform/windows/electron-main/window.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,15 @@ export class CodeWindow extends Disposable implements ICodeWindow {
307307
this.setFullScreen(true);
308308
}
309309

310-
if (!this._win.isVisible()) {
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+
) {
311319
this._win.show(); // to reduce flicker from the default window size to maximize, we only show after maximize
312320
}
313321
mark('code/didMaximizeCodeWindow');
@@ -792,7 +800,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
792800
this.focus({ force: true });
793801
this._win.webContents.openDevTools();
794802
}
795-
796803
}, 10000)).schedule();
797804
}
798805

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy