diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2025-04-15 11:59:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-15 09:59:30 +0000 |
commit | 1ea80c4335f7858f0550832e92635e3682ac5b0e (patch) | |
tree | 2453df9dca49b450b98b49eaf71060d1c383fb4a /components/compositing/touch.rs | |
parent | fe4306fc301b3651ed08017fff2178bfbde50ce6 (diff) | |
download | servo-1ea80c4335f7858f0550832e92635e3682ac5b0e.tar.gz servo-1ea80c4335f7858f0550832e92635e3682ac5b0e.zip |
touch: Fix panic with -Zconvert-mouse-to-touch (#36531)
- We previously converted all mouse move events to touch events, but we
should only be doing that while a mouse button is pressed (a finger
always does touch-down -> move -> up / cancel)
- Only consider Left mouse button for mouse-to-touch. We currently
already hardcode TouchId 0, which we would need to change in order to
properly support Multi-touch. Since we don't have any Multi-touch
gestures at the moment, we leave this unimplemented and simply only
evaluate the left mouse button.
Testing: Manual testing. We don't have servodriver support yet.
Fixes: #36526
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Diffstat (limited to 'components/compositing/touch.rs')
-rw-r--r-- | components/compositing/touch.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/compositing/touch.rs b/components/compositing/touch.rs index 19df220a469..76d87732b32 100644 --- a/components/compositing/touch.rs +++ b/components/compositing/touch.rs @@ -282,6 +282,10 @@ impl TouchHandler { debug_assert!(old.is_some(), "Sequence already removed?"); } + pub fn try_get_current_touch_sequence(&self) -> Option<&TouchSequenceInfo> { + self.touch_sequence_map.get(&self.current_sequence_id) + } + pub fn get_current_touch_sequence_mut(&mut self) -> &mut TouchSequenceInfo { self.touch_sequence_map .get_mut(&self.current_sequence_id) |