mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Allow OHOS servoshell to have a simple multiple tab implementation. (#36891)
Currently we just pause the compositor and replace the window in it while having separate bookkeeping to remember which window belongs to which tab. Currently there are no tests for OHOS, so we cannot test the changes. --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
This commit is contained in:
parent
71bf9fb92d
commit
3b73b83a9f
6 changed files with 245 additions and 87 deletions
|
@ -292,6 +292,10 @@ impl TouchHandler {
|
|||
.expect("Current Touch sequence does not exist")
|
||||
}
|
||||
|
||||
fn try_get_current_touch_sequence_mut(&mut self) -> Option<&mut TouchSequenceInfo> {
|
||||
self.touch_sequence_map.get_mut(&self.current_sequence_id)
|
||||
}
|
||||
|
||||
pub(crate) fn get_touch_sequence(&self, sequence_id: TouchSequenceId) -> &TouchSequenceInfo {
|
||||
self.touch_sequence_map
|
||||
.get(&sequence_id)
|
||||
|
@ -374,7 +378,12 @@ impl TouchHandler {
|
|||
id: TouchId,
|
||||
point: Point2D<f32, DevicePixel>,
|
||||
) -> TouchMoveAction {
|
||||
let touch_sequence = self.get_current_touch_sequence_mut();
|
||||
// As `TouchHandler` is per `WebViewRenderer` which is per `WebView` we might get a Touch Sequence Move that
|
||||
// started with a down on a different webview. As the touch_sequence id is only changed on touch_down this
|
||||
// move event gets a touch id which is already cleaned up.
|
||||
let Some(touch_sequence) = self.try_get_current_touch_sequence_mut() else {
|
||||
return TouchMoveAction::NoAction;
|
||||
};
|
||||
let idx = match touch_sequence
|
||||
.active_touch_points
|
||||
.iter_mut()
|
||||
|
@ -529,7 +538,10 @@ impl TouchHandler {
|
|||
}
|
||||
|
||||
pub fn on_touch_cancel(&mut self, id: TouchId, _point: Point2D<f32, DevicePixel>) {
|
||||
let touch_sequence = self.get_current_touch_sequence_mut();
|
||||
// A similar thing with touch move can happen here where the event is coming from a different webview.
|
||||
let Some(touch_sequence) = self.try_get_current_touch_sequence_mut() else {
|
||||
return;
|
||||
};
|
||||
match touch_sequence
|
||||
.active_touch_points
|
||||
.iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue