Skip to main content

Module windows

Module windows 

Source
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§

WindowReadback
WindowSpec

Enums§

RevealStyle
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 name rightkit-qa-driver listens on. Announcing never shows, orders or focuses a window.

Traits§

RevealTarget
The window calls one reveal makes, so every path is testable (and recordable) without a window.

Functions§

apply_reveal
Do exactly what mode allows. Ok(true) when the window was brought up, Ok(false) when nothing was (forbidden, or a Full order-back that failed). Forbidden makes no call at all.
builder
A WebviewWindowBuilder carrying the shell policy: popup handling through crate::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_X wide, CLAMP_MARGIN_Y tall 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_visible cannot mask a failed native order.
reveal
Show + unminimize + focus, as the host’s visibility policy allows (never-show makes this a no-op). None targets the main window.
reveal_with
reveal naming 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 the begin and done announcements. done is queued on the main thread behind the size and position calls place made, so it is not announced before they apply.