From 0282ca4a5d027612b3fb35674a3d87584ee05bac Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 23 Jun 2021 00:19:19 -0700 Subject: [PATCH] fix: window ordering on mac --- shell/browser/native_window_mac.mm | 2 -- spec-main/api-browser-window-spec.ts | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 3572da7161086..13968da736e4c 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -1647,8 +1647,6 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } void NativeWindowMac::SetActive(bool is_key) { - if (is_key) - widget()->Activate(); is_active_ = is_key; } diff --git a/spec-main/api-browser-window-spec.ts b/spec-main/api-browser-window-spec.ts index 284a15e16158a..115799842b2e0 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -4304,6 +4304,18 @@ describe('BrowserWindow module', () => { await leaveFullScreen; expect(w.isFullScreen()).to.be.false('isFullScreen'); }); + + it('multiple windows inherit correct fullscreen state', async () => { + const w = new BrowserWindow(); + const enterFullScreen = emittedOnce(w, 'enter-full-screen'); + w.setFullScreen(true); + await enterFullScreen; + expect(w.isFullScreen()).to.be.true('isFullScreen'); + await delay(); + const w2 = new BrowserWindow(); + await delay(); + expect(w2.isFullScreen()).to.be.true('isFullScreen'); + }); }); describe('closable state', () => {