From 6ceb9fd692ffefb8d2146cfc16375740e3b96ac7 Mon Sep 17 00:00:00 2001 From: shivesh-ganju Date: Tue, 18 Oct 2022 17:49:16 -0400 Subject: [PATCH] [fuchsia][scenic] Fix invalid viewRef error in pointer injection. This CL fixes the bug in pointer injector delegate where the viewRef is incorrectly cloned in the flatland platform view, causing an invalid viewRef to be passed in the Fidl request. Test: flutter-embedder-test --- shell/platform/fuchsia/flutter/flatland_platform_view.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/platform/fuchsia/flutter/flatland_platform_view.cc b/shell/platform/fuchsia/flutter/flatland_platform_view.cc index 6b9a5dfbd6517..52c7b1bf556a9 100644 --- a/shell/platform/fuchsia/flutter/flatland_platform_view.cc +++ b/shell/platform/fuchsia/flutter/flatland_platform_view.cc @@ -154,10 +154,11 @@ void FlatlandPlatformView::OnChildViewViewRef( fuchsia::ui::views::ViewRef view_ref) { FML_CHECK(child_view_info_.count(content_id) == 1); - focus_delegate_->OnChildViewViewRef(view_id, std::move(view_ref)); - fuchsia::ui::views::ViewRef view_ref_clone; fidl::Clone(view_ref, &view_ref_clone); + + focus_delegate_->OnChildViewViewRef(view_id, std::move(view_ref)); + pointer_injector_delegate_->OnCreateView(view_id, std::move(view_ref_clone)); OnChildViewConnected(content_id); }