mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Handle Touch events in dispatch_pending_point_input_events
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
parent
c7eba2dbba
commit
2fe10ba936
1 changed files with 10 additions and 2 deletions
|
@ -372,7 +372,7 @@ impl WebViewRenderer {
|
|||
}
|
||||
|
||||
pub(crate) fn dispatch_pending_point_input_events(&self) {
|
||||
while let Some(event) = self.pending_point_input_events.borrow_mut().pop_front() {
|
||||
while let Some(mut event) = self.pending_point_input_events.borrow_mut().pop_front() {
|
||||
// Events that do not need to do hit testing are sent directly to the
|
||||
// constellation to filter down.
|
||||
let Some(point) = event.point() else {
|
||||
|
@ -391,7 +391,15 @@ impl WebViewRenderer {
|
|||
return;
|
||||
};
|
||||
|
||||
self.global.borrow_mut().update_cursor(point, &result);
|
||||
match event {
|
||||
InputEvent::Touch(ref mut touch_event) => {
|
||||
touch_event.init_sequence_id(self.touch_handler.current_sequence_id);
|
||||
},
|
||||
InputEvent::MouseButton(_) | InputEvent::MouseMove(_) | InputEvent::Wheel(_) => {
|
||||
self.global.borrow_mut().update_cursor(point, &result);
|
||||
},
|
||||
_ => unreachable!("Unexpected input event type: {event:?}"),
|
||||
}
|
||||
|
||||
if let Err(error) = self.global.borrow().constellation_sender.send(
|
||||
EmbedderToConstellationMessage::ForwardInputEvent(self.id, event, Some(result)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue