list_windows

Function list_windows 

Source
pub fn list_windows(state: &Arc<AppState>) -> Value
Expand description

List all open window labels, excluding unpromoted pool windows. Pool windows are pre-warmed tear-off scratch windows kept hidden from the user (WS_EX_TOOLWINDOW, no taskbar entry). Including them in list_windows inflates the frontend’s InstancePanel row count with phantom entries the user can’t see or focus.

Uses state.user_visibility_snapshot() — atomic read of pool inventory (unpromotedpool.queue) and the browser registry under one host_state lock. Both unpromoted (populated at spawn time) and pool.queue (populated after renderer-ready, before promote) are host-internal: the window is hidden off-screen and has no UI a user could see or focus. The atomic read is required because a two-lock variant races against promote_pool_window.