diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.cc index 25012e7ba0..ecd80fec24 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.cc @@ -5,6 +5,8 @@ #include "pointer_delegate.h" #include +#include +#include #include @@ -318,6 +320,23 @@ void InsertIntoBuffer( } } // namespace +PointerDelegate::PointerDelegate( + fuchsia::ui::pointer::TouchSourceHandle touch_source, + fuchsia::ui::pointer::MouseSourceHandle mouse_source) + : touch_source_(touch_source.Bind()), mouse_source_(mouse_source.Bind()) { + if (touch_source_) { + touch_source_.set_error_handler([](zx_status_t status) { + FML_LOG(ERROR) << "TouchSource channel error: << " + << zx_status_get_string(status); + }); + } + if (mouse_source_) { + mouse_source_.set_error_handler([](zx_status_t status) { + FML_LOG(ERROR) << "MouseSource channel error: << " + << zx_status_get_string(status); + }); + } +} // Core logic of this class. // Aim to keep state management in this function. void PointerDelegate::WatchLoop( diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.h b/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.h index d8c592a0a7..996130ef4d 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/pointer_delegate.h @@ -35,9 +35,7 @@ struct IxnHasher { class PointerDelegate { public: PointerDelegate(fuchsia::ui::pointer::TouchSourceHandle touch_source, - fuchsia::ui::pointer::MouseSourceHandle mouse_source) - : touch_source_(touch_source.Bind()), - mouse_source_(mouse_source.Bind()) {} + fuchsia::ui::pointer::MouseSourceHandle mouse_source); // This function collects Fuchsia's TouchPointerSample and MousePointerSample // data and transforms them into flutter::PointerData structs. It then calls