From fc06c55bc0dd979b2e1b564afdfb56d9b69692b9 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 00:22:49 -0700 Subject: [PATCH] fix: window ordering on mac (#30067) * fix: window ordering on mac * chore: fix flaky fullscreen inheritance test Co-authored-by: deepak1556 --- shell/browser/native_window_mac.mm | 2 -- spec-main/api-browser-window-spec.ts | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index a7f14b4454379..2e19613ded451 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -1781,8 +1781,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 7b117d96b5fd0..a85ad8ce4aa05 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -4256,6 +4256,20 @@ 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({ show: false }); + const enterFullScreen2 = emittedOnce(w2, 'enter-full-screen'); + w2.show(); + await enterFullScreen2; + expect(w2.isFullScreen()).to.be.true('isFullScreen'); + }); }); describe('closable state', () => {