Browse Source

fix: window ordering on mac (#29857)

Robo 3 years ago
parent
commit
ccfde6c9d4
2 changed files with 12 additions and 2 deletions
  1. 0 2
      shell/browser/native_window_mac.mm
  2. 12 0
      spec-main/api-browser-window-spec.ts

+ 0 - 2
shell/browser/native_window_mac.mm

@@ -1682,8 +1682,6 @@ void NativeWindowMac::NotifyWindowWillLeaveFullScreen() {
 }
 
 void NativeWindowMac::SetActive(bool is_key) {
-  if (is_key)
-    widget()->Activate();
   is_active_ = is_key;
 }
 

+ 12 - 0
spec-main/api-browser-window-spec.ts

@@ -4203,6 +4203,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', () => {