Skip to content

feat(app): add dockIconFollowsWindows for menu-bar / tray apps#334

Merged
kdroidFilter merged 1 commit into
mainfrom
feat/dock-icon-follows-windows
Jul 13, 2026
Merged

feat(app): add dockIconFollowsWindows for menu-bar / tray apps#334
kdroidFilter merged 1 commit into
mainfrom
feat/dock-icon-follows-windows

Conversation

@kdroidFilter

@kdroidFilter kdroidFilter commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds nucleusApplication(dockIconFollowsWindows = true): the app runs as a macOS accessory (no Dock icon, no menu bar) while no dockable window is visible, and switches to a regular app while at least one is — mirroring the pre-Tao WindowVisibilityMonitor behavior, driven natively.
  • New TaoDockPolicy reference-counts visible DecoratedWindows created with hiddenFromDock = false and flips the activation policy via NativeTaoMacOsDecoBridge.nativeSetHiddenFromDock on the 0↔1 transition.
  • DecoratedWindow counts in/out via a DisposableEffect(visible); standalone TaoStandalonePopup tray popups never contribute, so a tray-only app stays out of the Dock.
  • TaoLauncher applies the opt-in from the root composition (Tao main thread) so a tray-only app drops out of the Dock at startup.

Platform notes

  • macOS-only in effect: only macOS keeps an app-level Dock icon that persists without windows, so it needs the app-wide activation-policy toggle.
  • Windows / Linux: the taskbar is per-window and the standalone popup already opts out (WS_EX_TOOLWINDOW / override-redirect), so "taskbar entry ⟺ real window visible" is the native behavior there — the flag is a no-op by design.

Test plan

  • Tray-only app (no DecoratedWindow) → no Dock icon at startup or ever
  • Tray + window: window visible → Dock icon; close window → icon disappears; reopen → icon returns
  • Tray popup alone (window closed) does not bring back the Dock icon
  • dockIconFollowsWindows = false (default) → unchanged (regular app keeps its Dock icon)
  • Windows / Linux X11 unaffected (taskbar already per-window)

Opt-in via nucleusApplication(dockIconFollowsWindows = true): the app runs as
an accessory (no macOS Dock icon) while no dockable window is visible and
switches to a regular app while at least one is — the pre-Tao WindowVisibilityMonitor
behavior, driven natively.

- TaoDockPolicy reference-counts visible DecoratedWindows with hiddenFromDock=false
  and toggles the activation policy via NativeTaoMacOsDecoBridge.nativeSetHiddenFromDock
  on the 0<->1 transition.
- DecoratedWindow counts in/out through a DisposableEffect(visible); standalone
  TaoStandalonePopup tray popups never contribute.
- TaoLauncher applies the opt-in from the root composition (main thread) so a
  tray-only app drops out of the Dock at startup.

macOS-only in effect: Windows/Linux have no app-level Dock presence — their taskbar
is per-window, and the standalone popup already opts out via WS_EX_TOOLWINDOW /
override-redirect, so the behavior is native there.
@kdroidFilter kdroidFilter merged commit 358f955 into main Jul 13, 2026
21 of 22 checks passed
@kdroidFilter kdroidFilter deleted the feat/dock-icon-follows-windows branch July 13, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant