apply_hwnd_opened

Function apply_hwnd_opened 

Source
pub fn apply_hwnd_opened(
    state: &mut State,
    hwnd: u64,
    class_name: String,
    title: String,
    label_hint: Option<String>,
    now_ms: u64,
) -> Vec<Event>
Expand description

Phase B.9.1 — handle Command::ReportHwndOpened. Either:

  1. The hwnd’s label_hint matches an existing state.windows[label] whose hwnd is None → link them.
  2. No matching label → stash in state.pending_hwnds for a later reconciliation. If the class name doesn’t look like an AgentMux window (filtered at the host hook, but defense-in-depth here too), don’t even stash.