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: u64Milliseconds-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: boolPhase B.9.1 — last-known IsWindowVisible state.
iconic: boolPhase 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: boolPhase 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.
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.
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: boolSee hidden_since_open_emitted doc above.
corrective_window_move_emitted: boolSee hidden_since_open_emitted doc above.
Trait Implementations§
Source§impl Clone for WindowMirror
impl Clone for WindowMirror
Source§fn clone(&self) -> WindowMirror
fn clone(&self) -> WindowMirror
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowMirror
impl Debug for WindowMirror
impl Eq for WindowMirror
Source§impl PartialEq for WindowMirror
impl PartialEq for WindowMirror
impl StructuralPartialEq for WindowMirror
Auto Trait Implementations§
impl Freeze for WindowMirror
impl RefUnwindSafe for WindowMirror
impl Send for WindowMirror
impl Sync for WindowMirror
impl Unpin for WindowMirror
impl UnsafeUnpin for WindowMirror
impl UnwindSafe for WindowMirror
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.