From 12f842d038c69f842f8c458fe708a099e24c1db0 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sun, 1 Nov 2026 15:33:26 +0800 Subject: [PATCH] fix(macos): prevent menu bar flicker when closing the window Keep the application activation policy unchanged when hiding the main window. Lightweight mode still hides the Dock icon. Closes #8319 --- src-tauri/src/feat/window.rs | 1 - src-tauri/src/lib.rs | 3 --- 2 files changed, 4 deletions(-) diff --git a/src-tauri/src/feat/window.rs b/src-tauri/src/feat/window.rs index e618701ed..f3bf5db7b 100644 --- a/src-tauri/src/feat/window.rs +++ b/src-tauri/src/feat/window.rs @@ -316,7 +316,6 @@ pub async fn hide() { { let _ = window.hide(); } - handle::Handle::global().set_activation_policy_accessory(); } #[cfg(test)] diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 7e11e5c02..24d3f5203 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -289,9 +289,6 @@ pub fn run() -> std::process::ExitCode { } pub fn handle_window_close(api: &tauri::WindowEvent) { - #[cfg(target_os = "macos")] - handle::Handle::global().set_activation_policy_accessory(); - if core::handle::Handle::global().is_exiting() { return; }