Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

fix: handle hidden login window reopen

altic-devca33b259eca3
diff --git a/Sources/Fluid/AppDelegate.swift b/Sources/Fluid/AppDelegate.swift
index f1d252f4..b4312269 100644
--- a/Sources/Fluid/AppDelegate.swift
+++ b/Sources/Fluid/AppDelegate.swift
@@ -76,9 +76,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
// Ensure dock-icon reopen always foregrounds FluidVoice.
sender.activate(ignoringOtherApps: true)
- self.bringMainWindowToFrontIfPresent()
- return true
+ return !self.bringMainWindowToFrontIfPresent()
}
func userNotificationCenter(
@@ -167,7 +166,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
// Give ContentView.onAppear time to finish its startup work (menu bar setup plus
// the delayed service initialization), then put the window away. Alpha is restored
// so opening it later from the menu bar shows it normally.
- DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
+ DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) { [weak mainWindow] in
+ guard let mainWindow, mainWindow.alphaValue <= 0.01 else { return }
mainWindow.orderOut(nil)
mainWindow.alphaValue = originalAlpha
DebugLogger.shared.info(
@@ -205,6 +205,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
@discardableResult
private func bringMainWindowToFrontIfPresent() -> Bool {
if let mainWindow = NSApp.windows.first(where: self.isMainWindow) {
+ if mainWindow.alphaValue <= 0.01 {
+ mainWindow.alphaValue = 1
+ }
mainWindow.orderFrontRegardless()
mainWindow.makeKeyAndOrderFront(nil)
DebugLogger.shared.debug("Brought main window to front", source: "AppDelegate")
diff --git a/Sources/Fluid/Services/MenuBarManager.swift b/Sources/Fluid/Services/MenuBarManager.swift
index e493437b..dc59882a 100644
--- a/Sources/Fluid/Services/MenuBarManager.swift
+++ b/Sources/Fluid/Services/MenuBarManager.swift
@@ -746,6 +746,9 @@ final class MenuBarManager: NSObject, ObservableObject, NSMenuDelegate {
private func bringToFront(_ window: NSWindow) {
// Keep ordering explicit to avoid "opened but behind other apps" behavior.
+ if window.alphaValue <= 0.01 {
+ window.alphaValue = 1
+ }
window.orderFrontRegardless()
window.makeKeyAndOrderFront(nil)
}