#[non_exhaustive]pub enum PenBatching {
PerPacket,
Coalesce,
}Expand description
How a drained pen batch reaches the tree.
A digitizer runs at 200-360 Hz and a window’s message rate does not, so one
poll_pen drain routinely holds several packets. Both answers to “what does
the tree see?” are defensible and the trade is real, which is why this is a
knob rather than a decision baked in:
PerPacketspends a whole tree dispatch — hit test, arbitration turn, handler walk — on every packet. Nothing is lost and nothing is coalesced; it is what the pen path has always done.Coalescespends one dispatch per drain and hands the intermediate positions over asPointerSample::coalesced, each keeping its own time and its own axes. A surface that readsEventContext::coalescedsees exactly the same positions; one that does not sees fewer moves.
Transitions are never folded. Down, Up, a button change and proximity
enter/leave each keep their own sample under either mode, so no recognizer
sees a different sequence — only the number of PointerMoves between two
transitions changes.
Four of those five the fold can see for itself, because all it tests is
the phase and the button: Down and Up are not Move, a button change reports
a button, and proximity leave is a
PointerPhase::Cancel, so it breaks a
run for free. The fifth it cannot, and that one is handled by name rather
than by luck: proximity enter has no phase of its own — it is carried as
a move with nothing held — so poll_pen pins it, because folding it away
would not cost a PointerMove but a PointerEnter: the tree derives the
hover owner, the cursor and the tooltip dwell from a sample’s position and
never from its batched list, and a tool that came into range over one widget
and hovered onto another inside one drain would otherwise never enter the
first.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PerPacket
One PointerSample per packet. The
default, and what the pen path did before this existed.
Coalesce
One sample per transition; the pure-motion packets between two
transitions ride in
PointerSample::coalesced.
Trait Implementations§
Source§impl Clone for PenBatching
impl Clone for PenBatching
Source§fn clone(&self) -> PenBatching
fn clone(&self) -> PenBatching
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PenBatching
Source§impl Debug for PenBatching
impl Debug for PenBatching
Source§impl Default for PenBatching
impl Default for PenBatching
Source§fn default() -> PenBatching
fn default() -> PenBatching
impl Eq for PenBatching
Source§impl PartialEq for PenBatching
impl PartialEq for PenBatching
impl StructuralPartialEq for PenBatching
Auto Trait Implementations§
impl Freeze for PenBatching
impl RefUnwindSafe for PenBatching
impl Send for PenBatching
impl Sync for PenBatching
impl Unpin for PenBatching
impl UnsafeUnpin for PenBatching
impl UnwindSafe for PenBatching
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.