From 6cb747e9c9f7b1f2483b779e6586efa8c7914e89 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 13:54:57 -0700 Subject: [PATCH] fix: restore original BrowserWindow.show() behavior (#42306) The new activate API on macOS is pretty bad, we should just keep using the old API. Similar to #42180. Restores non-panel behavior to pre-panel support. Notes: BrowserWindow.show() now correctly restores focus to inactive apps on macOS Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard --- shell/browser/native_window_mac.mm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 19de8c55cd5..4eb94a6bda7 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -456,11 +456,7 @@ void NativeWindowMac::Show() { // Panels receive key focus when shown but should not activate the app. if (!IsPanel()) { - if (@available(macOS 14.0, *)) { - [[NSApplication sharedApplication] activate]; - } else { - [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; - } + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; } [window_ makeKeyAndOrderFront:nil]; }