From ebd78ae9ffb8c8e5632339bc65a2c9345b27a8f2 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Tue, 3 Nov 2026 00:55:35 +0800 Subject: [PATCH] revert(macos): restore Dock hiding when closing the window This reverts commit 12f842d038c69f842f8c458fe708a099e24c1db0. Restore the Accessory activation policy when closing the main window or using Cmd+W so the Dock icon disappears again. Keeping the Regular policy avoided menu bar jitter but caused the Dock visibility regression in #8513. Hiding the application before switching to Accessory did not reliably eliminate the jitter. An isolated Tao 0.37.2 checkout with a native muda menu reproduced it on macOS 27.2 without CVR or WebView. The responsible layer remains undetermined and needs separate investigation. The menu bar jitter reported in #8319 can still occur; this revert restores Dock behavior and does not claim to fix that issue. Closes #8513 --- src-tauri/src/feat/window.rs | 1 + src-tauri/src/lib.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src-tauri/src/feat/window.rs b/src-tauri/src/feat/window.rs index f3bf5db7b..e618701ed 100644 --- a/src-tauri/src/feat/window.rs +++ b/src-tauri/src/feat/window.rs @@ -316,6 +316,7 @@ 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 24d3f5203..7e11e5c02 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -289,6 +289,9 @@ 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; }