Skip to main content

fret_runtime/
window_input_arbitration.rs

1use fret_core::NodeId;
2
3/// Window-level pointer occlusion mode published by the UI runtime.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
5pub enum WindowPointerOcclusion {
6    /// No occlusion; pointer events route normally via hit-testing.
7    #[default]
8    None,
9    /// Blocks pointer interaction (hover/move/down/up) for underlay roots.
10    BlockMouse,
11    /// Blocks pointer interaction for underlay roots, but allows scroll wheel forwarding.
12    BlockMouseExceptScroll,
13}
14
15/// Window-scoped input arbitration snapshot published by the UI runtime.
16///
17/// This is a data-only integration seam used by policy-heavy ecosystem crates and runner/platform
18/// layers that need to observe modal/capture/occlusion state without depending on `fret-ui`
19/// internals.
20#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
21pub struct WindowInputArbitrationSnapshot {
22    pub modal_barrier_root: Option<NodeId>,
23    pub focus_barrier_root: Option<NodeId>,
24    pub pointer_occlusion: WindowPointerOcclusion,
25    pub pointer_occlusion_root: Option<NodeId>,
26    pub pointer_capture_active: bool,
27    /// When all captured pointers belong to the same layer root, this reports that root.
28    pub pointer_capture_root: Option<NodeId>,
29    /// `true` when capture spans multiple roots or cannot be mapped to a single root.
30    pub pointer_capture_multiple_roots: bool,
31}