From 435003566dbfe0aedbe52b39774f32148635ed00 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 14 May 2024 15:52:08 -0700 Subject: [PATCH] fix: restore non-panel focus behavior (#42180) --- shell/browser/native_window_mac.mm | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index e9909c0a53..abb02e9b75 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -426,20 +426,7 @@ void NativeWindowMac::Focus(bool focus) { // If we're a panel window, we do not want to activate the app, // which enables Electron-apps to build Spotlight-like experiences. if (!IsPanel()) { - // On macOS < Sonoma, "activateIgnoringOtherApps:NO" would not - // activate apps if focusing a window that is inActive. That - // changed with macOS Sonoma, which also deprecated - // "activateIgnoringOtherApps". - // - // There's a slim chance we should have never called - // activateIgnoringOtherApps, but we tried that many years ago - // and saw weird focus bugs on other macOS versions. So, to make - // this safe, we're gating by versions. - if (@available(macOS 14.0, *)) { - [[NSApplication sharedApplication] activate]; - } else { - [[NSApplication sharedApplication] activateIgnoringOtherApps:NO]; - } + [[NSApplication sharedApplication] activateIgnoringOtherApps:NO]; } [window_ makeKeyAndOrderFront:nil]; } else {