Skip to main content

Module pointer

Module pointer 

Source
Expand description

Core pointer resolution: one host-agnostic stage that turns untargeted raw pointer samples (EventFlags::RAW_POINTER, see nativeview_abi::EventBatchBuf::push_pointer_raw) into the targeted W3C Pointer Events stream every app sees, on every host.

Per sample the stage runs, in order:

  1. Top-layer press (primary PointerDown): the HTML “hide popovers until” walk (super::top_layer_press) emits the light-dismiss close events; a press outside the topmost modal is swallowed (PointerOutcomeFlags::MODAL_BARRIER) until it ends.
  2. Hit-test / capture: a captured pointer targets its capture node; otherwise the deepest interaction target (PointerHitTest). Captures are W3C: pending targets ([InteractionTracker::pointers_mut]) switch before the pointer’s next sample, emitting LostPointerCapture / GotPointerCapture; touch and pen capture their down target implicitly; a capture_on_primary_down owner (nativeview_engine::ext::input::capture_owner) claims the pointer (PointerOutcomeFlags::CLAIMED).
  3. PointerTable + tracker: :hover follows the primary hover-capable pointer, :active and Press the primary pointer only; a contact beyond the table’s capacity is refused (PointerOutcomeFlags::REFUSED) with a PointerCancel.
  4. Synthesis: non-bubbling PointerLeave / PointerEnter transitions, the targeted pointer event, capture changes, and Press on a primary release over the press chain.

Resolution is split in two so a hit tester may borrow the scene (or the backend owning it): PointerProbe::new reads (hits, top-layer decision, capture owner) and LaidOutScene::apply_pointer mutates the tracker. LaidOutScene::resolve_pointer runs both against the scene’s own hit test (SurfaceRuntime); the Skia backend probes with its paint-accurate hit test. Zero heap allocations in steady state.

Structs§

PointerOutcomeFlags
What the core pointer-resolution stage did with a batch’s raw samples (NV_POINTER_OUTCOME_*, bits 8.. of the dispatch_events_ex disposition word).
PointerProbe
The read-only half of resolution (see the module docs).
PointerResolution
What one raw sample resolved to.
SceneGeometry
PointerGeometry over LaidOutScene::visual_rect_of.

Traits§

PointerHitTest
The geometry queries the stage needs. Backends with paint-accurate state (live animated transforms, the painted stacking plan) implement it over their own hit test.