Apply delay when epoch is mismatch for touch events

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
batu_hoang 2025-05-30 14:40:24 +08:00
parent 54d37638b4
commit afa3f4bba2
2 changed files with 35 additions and 12 deletions

View file

@ -814,13 +814,12 @@ impl IOCompositor {
let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) else {
return warn!("Could not find WebView for incoming display list");
};
// epoch is outdated until we receive "NewWebRenderFrameReady" message.
webview_renderer.epoch_not_synchronized.set(true);
let pipeline_id = display_list_info.pipeline_id;
let details = webview_renderer.ensure_pipeline_details(pipeline_id.into());
details.most_recent_display_list_epoch = Some(display_list_info.epoch);
details.hit_test_items = display_list_info.hit_test_info;
details.install_new_scroll_tree(display_list_info.scroll_tree);
@ -1664,7 +1663,7 @@ impl IOCompositor {
if found_recomposite_msg {
// Process all pending events
self.webview_renderers.iter().for_each(|webview| {
webview.dispatch_pending_input_events();
webview.dispatch_pending_point_input_events();
webview.epoch_not_synchronized.set(false);
});
}