Expand description
Startup / shutdown order and RunEvent routing.
Startup (plugin setup, then Tauri creates windows):
- single-instance arbitration (a second launch forwards argv and exits before anything heavy)
- shared state managed, 3. native menu, 4. tray
- engine started off the UI thread (never blocks first paint), 6. watchdog
- each webview becomes ready: native hardening, saved geometry restored, window shown
(unless launched with
--background) - deep links queued from argv are delivered when the frontend calls
rk_shell_ready
Shutdown (quit -> ExitRequested -> Exit): mark exiting (new engine calls refused), save
window geometry, stop the engine (bounded), remove the tray, release the single-instance
service.
Donors: HeardRight tray.rs Quit (engine shutdown before exit), hub_window (close hides,
Dock reopen restores), ViewRight RunEvent::Reopen, CodeRight window_state save hooks.
Structs§
- Activation
Tracker - Remembers the policy last applied so only real changes reach the OS.
- Show
Policy - The host’s say over window visibility, evaluated by
ShowPolicy::mode.
Enums§
- Activation
- macOS activation policy, mirrored so the decision is testable on every host.
- Instance
Mode - How a launch takes part in single-instance arbitration.
- Reveal
Mode - What the guard allows for one reveal.
- Reveal
Source - Why the shell is bringing a window up. Every source asks the same guard (
reveal_mode). - Visibility
- What happened to the main window.
Constants§
- NEVER_
SHOW_ TRUTHY - The documented truthy values for a never-show environment variable, compared exactly (ASCII case-insensitive, no trimming).
Functions§
- activation_
for - The activation policy a hide or reveal asks for, when the host chose “hide to background”.
other_visible: some other window is still on screen, so the app must stay in the Dock. - env_
equals - True when the value is exactly
expected(case-sensitive, no trimming). - env_
means_ never_ show - True when an environment value means “never show”: exactly one of
NEVER_SHOW_TRUTHY(1,true,yes,on), ASCII case-insensitive. Anything else (unset, empty,0, padded or unrecognised text) is off. - instance_
mode - Pure decision for
InstanceMode. - launched_
in_ background - True when this launch asked to stay in the tray (
--background). - never_
show - True when the host forbade showing windows (builder flag or registered environment variable).
- qa_
background - qa_
hidden - QA-only launch policy. The harness sets this before the frontend exists so every
shell-owned show/reopen path can preserve the user’s foreground app. Compiled out of
product releases: without debug assertions the selector is not read at all and the answer
is always
false, so a shipped binary carries no QA hidden/background switch. - quit
- reopen_
wants_ reveal - A Dock reopen with no visible window is the only reopen that asks to reveal.
- repair_
cache_ enabled - Whether the startup cache repair runs: the host’s explicit choice, else on, except under
lifecycle_onlywhere the host owns its cache. - reveal_
mode - THE guard. Every path that shows, unminimises or focuses a window (reopen, opened, second
instance, show-on-ready, tray, the window command,
windows::open,windows::reveal, restore) asks this function and does exactly what the answer allows. WithoutShellState(a standalone helper outside the plugin) the default policy applies. - show_
on_ ready_ decision - Whether the main window is shown when its webview is ready.
- show_
on_ ready_ installed - Whether the
ShowOnReadybehaviour is installed.lifecycle_onlyturns the module off, and only the host’s explicitshow_on_ready(true)brings it back; every other module set is decided by the module alone.