#[non_exhaustive]pub enum CancelReason {
Show 15 variants
Platform,
WindowDeactivated,
Occluded,
ModalOpened,
SubtreeParked,
WidgetDestroyed,
CaptureOrphaned,
OsDragStarted,
ExternalDndTakeover,
PeerClaimed,
OverlayDismissed,
MultiContactIgnored,
ContactCapExceeded,
PalmRejected,
Deactivated,
}Expand description
Why a pointer interaction was revoked.
Declared in full here so the taxonomy is one enumeration rather than a
growing set of booleans, and so a consumer can match on it exhaustively.
Every variant reaches a widget through the one funnel,
WidgetTree::cancel_pointer, and is
delivered as a WidgetEvent::PointerCancel.
A handful name a producer whose own package has not landed and are marked
as such below; docs/touch-and-pen.md §3.3 carries the full table of who
raises each, who receives it, and what the widget must do about it.
#[non_exhaustive]: the taxonomy is expected to grow as backends reveal
revocation paths Teksilo has not met.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Platform
The OS itself revoked the pointer (a PointerCaptureLost, a
wl_touch.cancel, a compositor grab).
WindowDeactivated
The window lost focus mid-interaction.
Occluded
The window became fully occluded mid-interaction. Raised by the
platform layer’s occlusion path (WindowEvent::Occluded).
ModalOpened
A modal surface opened over the interaction.
SubtreeParked
The interacting subtree went dormant (a Switcher branch was parked, a
tab was switched away from).
WidgetDestroyed
The interacting widget was destroyed.
CaptureOrphaned
The widget holding the pointer capture went away, leaving the capture with no owner.
OsDragStarted
A native OS drag started from this press, so the in-app interaction ends.
ExternalDndTakeover
An external (OS) drag-and-drop session took the pointer over. Reserved for the inbound external-DnD path.
PeerClaimed
Another member of the gesture sequence won arbitration, so this one is revoked.
OverlayDismissed
The overlay the interaction lived in was dismissed under it.
MultiContactIgnored
A second contact arrived on a surface that handles only one, so the
interaction is abandoned rather than misread. Reserved for
MultiContact::First.
ContactCapExceeded
More simultaneous contacts arrived than the pointer table holds.
Refused at PointerTable::begin,
before any event exists, so no widget is told.
PalmRejected
The contact was classified as a palm rather than a deliberate touch.
A contact the backend flags is refused at
PointerTable::begin,
before any event exists, so no widget is told; one the PalmWatch
heuristic rejects on its release goes through the cancel funnel
instead, so its widget is told — which is the only way to guarantee
it fires no tap.
Deactivated
A catch-all for a deactivation that fits none of the above. Prefer a specific variant; this one exists so a caller is never forced to lie.