Expand description
Window creation and lifecycle helpers: hardened builders, reveal / toggle, secondary windows.
Donors: CodeRight os_shell/windows (bounded labels and dimensions, app-relative URLs only,
lifecycle event), HeardRight hub_window (reveal = show + unminimize + focus; macOS needs
app.show() first), ViewRight (hidden-until-first-paint).
Structs§
Enums§
- Reveal
Style - Which calls a foreground reveal makes.
Constants§
- EVENT_
PLACEMENT - App event announcing initial window placement (
phase"begin"/"done"), so a control server can hold viewport requests until placement and state restore have landed instead of racing them. Same namerightkit-qa-driverlistens on. Announcing never shows, orders or focuses a window.
Traits§
- Reveal
Target - The window calls one reveal makes, so every path is testable (and recordable) without a window.
Functions§
- apply_
reveal - Do exactly what
modeallows.Ok(true)when the window was brought up,Ok(false)when nothing was (forbidden, or aFullorder-back that failed).Forbiddenmakes no call at all. - builder
- A
WebviewWindowBuildercarrying the shell policy: popup handling throughcrate::nav, frameless chrome when the shell was configured for it, hidden until restored/shown. Navigation, init scripts and native hardening come from the shell plugin for every webview. - correct_
offscreen - Move a window rectangle (logical pixels) back on-screen. A rectangle whose title strip is
reachable on some monitor (at least
CLAMP_MARGIN_Xwide,CLAMP_MARGIN_Ytall inside it) is returned unchanged; otherwise it is clamped onto the monitor nearest its centre. No monitors: unchanged. - open
- Create (or reveal) a secondary window described by
spec. - readback
- Read native window visibility/order after a show or order operation. macOS values
come from NSWindow, so Tauri’s logical
is_visiblecannot mask a failed native order. - reveal
- Show + unminimize + focus, as the host’s visibility policy allows (never-show makes this a
no-op).
Nonetargets the main window. - reveal_
with revealnaming why, for the guard.- safe_
label - spec_
min_ size - The effective minimum inner size of
spec: its own values, else the shell default. - toggle
- Hide when visible and focused-or-visible, otherwise reveal (tray left-click behaviour).
- with_
placement_ announced - Run
place(window-state restore and any other initial placement) between thebeginanddoneannouncements.doneis queued on the main thread behind the size and position callsplacemade, so it is not announced before they apply.