[PROPOSAL] Never lose the window (supports all modes) #1009
andreaspitzer
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
With the Dock icon hidden, FluidVoice's window keeps slipping behind other apps every time you click away, with no easy way to bring it back. This proposal fixes that while keeping every Dock-hiding setup, including the fully invisible one from #753, working as intended.
Moving this here from #997, as suggested, and starting with the concern raised there: #753.
What #753 asks for is a separate mode
#753 wants FluidVoice fully invisible: no menu bar icon and no Dock icon, used only through hotkeys. Opening the app from Applications to reach settings should leave "still nothing in the Dock or menu bar."
That mode doesn't exist yet. It depends on hiding the menu bar icon (#382), which is still open (#741 wasn't merged). Today, everyone who turns on "Hide from Dock & App Switcher" still has a menu bar icon, so they're running FluidVoice as a menu bar app.
The bug #753 actually reported, the Dock icon reappearing and staying, was fixed in #937.
The two modes need different behavior while a window is open
Hidden→ Shown (#997)The proposed change covers both: one rule decides the Dock icon, and it gives each mode what it needs. Only the menu bar app row changes today. The fully invisible row keeps the Dock hidden once #382 makes that mode possible.
Why the menu bar app needs the change (#997)
The window opens fine. But once you switch to another app, it drops behind everything, and there's no Dock icon to click and no Cmd+Tab entry. The only ways back are reopening from the menu bar or digging the window out from behind others. This is how macOS treats an app that hides its Dock icon (
.accessory): Apple's docs say such an app "doesn't appear in the Dock and doesn't have a menu bar, but it may be activated programmatically or by clicking on one of its windows" (docs).The fix: while a FluidVoice window is open, show the Dock icon (
.regular). When the last window closes, hide it again (.accessory). It's still a menu-bar-only app at rest, and the icon can't get stuck, so #937's fix stays intact.This is how other popular menu-bar apps behave
Each of these hides its Dock icon at rest, shows it while its settings/main window is open, and hides it again when the window closes:
AppDelegate.swiftL62-93WindowManager.swiftL50-58SettingsWindowManager.swiftL97-127SettingsWindowController.swiftL53-87MainWindow.swiftL54-67WindowCoordinator.swiftSettingsOpener.swiftThe approach is also described in the Apple Developer Forums thread "Best practice for activating a menubar app" and in Peter Steinberger's "Showing Settings from macOS Menu Bar Items" ("macOS doesn't allow a window to become selected when there's no Dock icon").
Implementation sketch
One rule decides the Dock icon, and every trigger (setting change, window opened, window closed, app reopened) goes through it:
When #382 adds the fully invisible mode, the rule gains one input: menu bar icon hidden and Dock hidden → always
.accessory, even with a window open.The setting's description would say the icon briefly appears while a window is open, and the "May require app restart" note would go (the change applies immediately).
I have a working implementation on a local branch and am happy to open a PR if the direction sounds good.
All reactions