Expand description
The live pointer table: one entry per pointer the tree currently knows about, and the two elected roles that replace the tree’s old singular pointer state.
§Three notions that used to be one
Before this table the tree had a single hovered, a single
last_pointer_position and a single pointer_captured_by, and “the
pointer” meant all three at once. Multi-touch splits that into three
genuinely different questions:
PointerInfo::primaryis the W3C Pointer Events Level 3 per-kind flag. Every mouse event is primary, and so is the first touch of a sequence. On a hybrid machine a mouse and a first touch are both primary. It is a property of the sample, decided by whoever produced it, and this table never rewrites it.PointerTable::primaryis Teksilo’s single pointer — the one that backs the legacy singular position accessor (WidgetTree::last_pointer_position). Exactly one live pointer holds the role, a mouse always wins it, and it is a table-level election rather than anything carried on a sample.PointerTable::hover_owneris the most recent hovering-capable pointer — a mouse, or a pen in proximity (PointerKind::hovers) — and the oneWidgetTree::hoveredreads.PointerTable::hover_owneris the most recent hovering-capable pointer — a mouse, or a pen in proximity (PointerKind::hovers).
Hover follows the hover owner, never the primary. Enter/leave, the
cursor, tooltip dwell and every on_hover handler are hover-owner-only, and
a touch contact is never a hover owner: a finger has no hover state to
report, so a contact that wrote hover would make every hover affordance fire
on tap and stick there after the lift. Affordances that today rely on hover
get their own touch routes; they do not get them by pretending a finger
hovers.
§Why a Vec
The live set is at most PointerTable::DEFAULT_CAP entries, so every
operation is a linear scan of a handful of elements — cheaper than hashing
a PointerId, and it keeps iteration in a stable, oldest-first order.
Reference: docs/touch-and-pen.md.
Structs§
- Pointer
Entry - Everything the tree tracks about one live pointer.
- Pointer
Table - The live pointers, plus the primary and hover-owner elections.