From ef13c7e9a050b9c8418ab77881caab3a1f1c9044 Mon Sep 17 00:00:00 2001 From: postoso Date: Mon, 3 Aug 2026 21:58:32 -0400 Subject: [PATCH] fix: preserve hidden Dock state on reopen --- Sources/Fluid/AppDelegate.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/Fluid/AppDelegate.swift b/Sources/Fluid/AppDelegate.swift index 82e9bf45..3760dd0a 100644 --- a/Sources/Fluid/AppDelegate.swift +++ b/Sources/Fluid/AppDelegate.swift @@ -128,6 +128,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele return true } + // LaunchServices restores the bundle's default activation policy on an external reopen. + // Re-apply the saved preference before foregrounding the existing app (#753). + self.applyDockVisibilityPolicy() + // Ensure dock-icon reopen always foregrounds FluidVoice. sender.activate(ignoringOtherApps: true) @@ -179,8 +183,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele } /// Apply the user's dock-visibility preference ("Hide from dock", issue #162). - /// Re-applied after operations that can reset the process activation policy - notably the - /// LaunchServices reopen below, which restores the bundle default (.regular) even when the + /// Re-applied after operations that can reset the process activation policy - notably + /// LaunchServices reopens, which restore the bundle default (.regular) even when the /// app is reopened without activation, so hide-from-dock is honored on login launches (#396). private func applyDockVisibilityPolicy() { NSApp.setActivationPolicy(SettingsStore.shared.showInDock ? .regular : .accessory)