WindowMirror

Struct WindowMirror 

Source
pub struct WindowMirror {
Show 15 fields pub label: String, pub kind: WindowKind, pub parent_label: Option<String>, pub opened_at: String, pub opened_at_ms: u64, pub hwnd: Option<u64>, pub visible: bool, pub iconic: bool, pub last_rect: Option<Rect>, pub last_foreground_at_ms: Option<u64>, pub foregrounded_since_open: bool, pub hidden_since_open_emitted: bool, pub hidden_since_open_deferred: bool, pub off_monitor_drift_emitted: bool, pub corrective_window_move_emitted: bool,
}
Expand description

Phase B.4 read-only mirror of one host-owned window. The launcher learns about windows via Command::ReportWindowOpened; the host remains authoritative until B.5 flips the direction. opened_at is the launcher’s clock at the time the report arrived (RFC3339) — useful for correlating launcher logs with host logs across version skew.

Phase B.9.1 (WRR) — the observability axis (hwnd, visible, iconic, last_rect, last_foreground_at_ms, foregrounded_since_open) is populated by the host’s Win32 event hooks. Pre-B.9 these all sit at default values, which is fine: the WRR drift checks only fire when at least one of the ReportHwnd* Commands arrives, and they don’t arrive in task dev mode (no launcher → no IPC) or installed mode until the host-side hooks land. Existing reducer paths (ReportWindowOpened, ReportWindowClosed, etc.) ignore these fields entirely.

Fields§

§label: String§kind: WindowKind§parent_label: Option<String>

Set only for Subwindow; identifies the FullInstance that owns this window so the eventual cascade-close logic (B.5) has the parent linkage.

§opened_at: String§opened_at_ms: u64

Milliseconds-since-launcher-start at which the host’s ReportWindowOpened arrived. Used by apply_hwnd_visibility_changed to suppress HiddenSinceOpen drift during the post-create placement grace window — CEF creates windows hidden, places them, then shows them, and the intermediate WM_HIDE events would otherwise fire spurious drift on every fresh window.

§hwnd: Option<u64>

Phase B.9.1 — Win32 HWND linked to this label by the WRR reducer arm (via ReportHwndOpened with matching label_hint or via the post-hoc reconciliation against pending_hwnds). None until the host’s ReportHwndOpened for this label arrives.

§visible: bool

Phase B.9.1 — last-known IsWindowVisible state.

§iconic: bool

Phase B.9.1 — last-known minimized state.

§last_rect: Option<Rect>

Phase B.9.1 — last-known window rect. None until the first ReportHwndPositionChanged arrives for the linked HWND.

§last_foreground_at_ms: Option<u64>

Phase B.9.1 — milliseconds-since-launcher-start of the most recent ReportHwndForegroundChanged for this label’s HWND. None if the window has never been foregrounded.

§foregrounded_since_open: bool

Phase B.9.1 — has this label been foregrounded at any point since its ReportWindowOpened? Used to fire HiddenSinceOpen drift on the first hide event when this is still false.

§hidden_since_open_emitted: bool

Drift-storm fix: HiddenSinceOpen / OffMonitor / CorrectiveWindowMove each fire AT MOST ONCE per window per session. Without these caps, a fresh top-level window that goes through several SetWindowPos transitions during host placement re-emits the same event for every intermediate snapshot — observed up to 170 events in 1 second, exhausting the renderer’s V8 stack and crashing it. The cap fires once; subscribers still see the signal, no storm.

OffMonitor shares the same risk as HiddenSinceOpen because apply_hwnd_position_changed fires per WM_MOVE — dragging an already-off-monitor window emits drift on every pixel. CorrectiveWindowMove rides with it (fires per position change while !foregrounded_since_open).

All three flags are monotonic for a window’s lifetime: once true, never reset (preserve via OR-with-prior on duplicate ReportWindowOpened, codex P2 PR #708 round 3).

See docs/specs/ANALYSIS_DRIFT_STORM_RENDERER_CRASH_2026-05-06.md for storm context.

§hidden_since_open_deferred: bool

Set when apply_hwnd_visibility_changed sees visible=false during the placement grace window. Marks “we suppressed a hide; if it persists past the grace, drift fires on the next reducer call via drain_deferred_hidden_since_open”. Cleared when the window subsequently becomes visible or is foregrounded. Without this, a window that goes hidden during grace and receives no further visibility events would permanently lose its HiddenSinceOpen drift signal (codex P2 PR #725 round 1).

§off_monitor_drift_emitted: bool

See hidden_since_open_emitted doc above.

§corrective_window_move_emitted: bool

See hidden_since_open_emitted doc above.

Trait Implementations§

Source§

impl Clone for WindowMirror

Source§

fn clone(&self) -> WindowMirror

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WindowMirror

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for WindowMirror

Source§

fn eq(&self, other: &WindowMirror) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for WindowMirror

Source§

impl StructuralPartialEq for WindowMirror

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more