apply_hwnd_destroyed

Function apply_hwnd_destroyed 

Source
pub fn apply_hwnd_destroyed(
    state: &mut State,
    hwnd: u64,
    host_running: bool,
) -> Vec<Event>
Expand description

Phase B.9.1 — handle Command::ReportHwndDestroyed. Three outcomes:

  1. HWND links to a WindowMirror AND we already received a ReportWindowClosed for that label (mirror is gone) → no drift, expected ordering.
  2. HWND links to a WindowMirror that’s STILL in state.windows → CEF didn’t report close yet. Renderer probably crashed → OrphanDestroy drift.
  3. HWND was pending (never linked) → drop the pending entry, no drift (it never claimed to be a real window).