From 8150b5ad53cf649a36d9811597f342108e6b46d9 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Fri, 1 Jul 2022 01:11:28 -0400 Subject: [PATCH 1/4] PointerScrollInertiaCancel Win32 --- shell/platform/windows/direct_manipulation.cc | 24 +++- shell/platform/windows/direct_manipulation.h | 8 ++ .../windows/direct_manipulation_unittests.cc | 108 ++++++++++++++++++ .../platform/windows/flutter_windows_view.cc | 16 +++ shell/platform/windows/flutter_windows_view.h | 8 ++ .../mock_window_binding_handler_delegate.h | 1 + .../windows/window_binding_handler_delegate.h | 4 + 7 files changed, 166 insertions(+), 3 deletions(-) diff --git a/shell/platform/windows/direct_manipulation.cc b/shell/platform/windows/direct_manipulation.cc index 02e0167fbf4e2..d0933fa5a9d19 100644 --- a/shell/platform/windows/direct_manipulation.cc +++ b/shell/platform/windows/direct_manipulation.cc @@ -43,6 +43,7 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged( IDirectManipulationViewport* viewport, DIRECTMANIPULATION_STATUS current, DIRECTMANIPULATION_STATUS previous) { + during_inertia_ = current == DIRECTMANIPULATION_INERTIA; if (during_synthesized_reset_ && previous == DIRECTMANIPULATION_RUNNING) { during_synthesized_reset_ = false; } else if (current == DIRECTMANIPULATION_RUNNING) { @@ -53,16 +54,28 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged( (int32_t) reinterpret_cast(this)); } } - } else if (previous == DIRECTMANIPULATION_RUNNING) { + } + if (previous == DIRECTMANIPULATION_RUNNING) { + // Reset deltas to ensure only inertia values will be compared later. + last_pan_delta_x_ = 0.0; + last_pan_delta_y_ = 0.0; if (owner_->binding_handler_delegate) { owner_->binding_handler_delegate->OnPointerPanZoomEnd( (int32_t) reinterpret_cast(this)); } + } else if (previous == DIRECTMANIPULATION_INERTIA) { + if (owner_->binding_handler_delegate && std::max(std::abs(last_pan_delta_x_), std::abs(last_pan_delta_y_)) > 0.01) { + owner_->binding_handler_delegate->OnScrollInertiaCancel((int32_t) reinterpret_cast(this)); + } // Need to reset the content transform to its original position // so that we are ready for the next gesture. // Use during_synthesized_reset_ flag to prevent sending reset also to the // framework. during_synthesized_reset_ = true; + last_pan_x_ = 0.0; + last_pan_y_ = 0.0; + last_pan_delta_x_ = 0.0; + last_pan_delta_y_ = 0.0; RECT rect; HRESULT hr = viewport->GetViewportRect(&rect); if (FAILED(hr)) { @@ -104,7 +117,11 @@ HRESULT DirectManipulationEventHandler::OnContentUpdated( float scale = c - (c - transform[0]); float pan_x = transform[4]; float pan_y = transform[5]; - if (owner_->binding_handler_delegate) { + last_pan_delta_x_ = pan_x - last_pan_x_; + last_pan_delta_y_ = pan_y - last_pan_y_; + last_pan_x_ = pan_x; + last_pan_y_ = pan_y; + if (owner_->binding_handler_delegate && !during_inertia_) { owner_->binding_handler_delegate->OnPointerPanZoomUpdate( (int32_t) reinterpret_cast(this), pan_x, pan_y, scale, 0); } @@ -144,7 +161,8 @@ int DirectManipulationOwner::Init(unsigned int width, unsigned int height) { DIRECTMANIPULATION_CONFIGURATION_INTERACTION | DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_X | DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_Y | - DIRECTMANIPULATION_CONFIGURATION_SCALING; + DIRECTMANIPULATION_CONFIGURATION_SCALING | + DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_INERTIA; RETURN_IF_FAILED(viewport_->ActivateConfiguration(configuration)); RETURN_IF_FAILED(viewport_->SetViewportOptions( DIRECTMANIPULATION_VIEWPORT_OPTIONS_MANUALUPDATE)); diff --git a/shell/platform/windows/direct_manipulation.h b/shell/platform/windows/direct_manipulation.h index 40317333f6916..d0b6abc0b1506 100644 --- a/shell/platform/windows/direct_manipulation.h +++ b/shell/platform/windows/direct_manipulation.h @@ -112,6 +112,14 @@ class DirectManipulationEventHandler // A flag is needed to ensure that false events created as the reset occurs // are not sent to the flutter framework. bool during_synthesized_reset_ = false; + // Store whether current events are from synthetic inertia rather than user input. + bool during_inertia_ = false; + // Store the difference between the last pan offsets to determine if inertia + // has been cancelled in the middle of an animation. + float last_pan_x_ = 0.0; + float last_pan_y_ = 0.0; + float last_pan_delta_x_ = 0.0; + float last_pan_delta_y_ = 0.0; }; } // namespace flutter diff --git a/shell/platform/windows/direct_manipulation_unittests.cc b/shell/platform/windows/direct_manipulation_unittests.cc index 5975103e849b8..1158e330abe57 100644 --- a/shell/platform/windows/direct_manipulation_unittests.cc +++ b/shell/platform/windows/direct_manipulation_unittests.cc @@ -259,5 +259,113 @@ TEST(DirectManipulationTest, TestRounding) { DIRECTMANIPULATION_INERTIA); } +TEST(DirectManipulationTest, TestInertiaCancelSentForUserCancel) { + MockIDirectManipulationContent content; + MockWindowBindingHandlerDelegate delegate; + MockIDirectManipulationViewport viewport; + const int DISPLAY_WIDTH = 800; + const int DISPLAY_HEIGHT = 600; + auto owner = std::make_unique(nullptr); + owner->SetBindingHandlerDelegate(&delegate); + auto handler = + fml::MakeRefCounted(owner.get()); + int32_t device_id = (int32_t) reinterpret_cast(handler.get()); + // No need to mock the actual gesture, just start at the end. + EXPECT_CALL(viewport, GetViewportRect(_)) + .WillOnce(::testing::Invoke([DISPLAY_WIDTH, DISPLAY_HEIGHT](RECT* rect) { + rect->left = 0; + rect->top = 0; + rect->right = DISPLAY_WIDTH; + rect->bottom = DISPLAY_HEIGHT; + return S_OK; + })); + EXPECT_CALL(viewport, ZoomToRect(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, false)) + .WillOnce(::testing::Return(S_OK)); + EXPECT_CALL(delegate, OnPointerPanZoomEnd(device_id)); + handler->OnViewportStatusChanged((IDirectManipulationViewport*)&viewport, + DIRECTMANIPULATION_INERTIA, + DIRECTMANIPULATION_RUNNING); + // Have pan_y change by 10 between inertia updates. + EXPECT_CALL(content, GetContentTransform(_, 6)) + .WillOnce(::testing::Invoke( + [](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 100; + return S_OK; + })); + handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, + (IDirectManipulationContent*)&content); + EXPECT_CALL(content, GetContentTransform(_, 6)) + .WillOnce(::testing::Invoke( + [](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 110; + return S_OK; + })); + handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, + (IDirectManipulationContent*)&content); + // This looks like an interruption in the middle of synthetic inertia because of user input. + EXPECT_CALL(delegate, OnScrollInertiaCancel(device_id)); + handler->OnViewportStatusChanged((IDirectManipulationViewport*)&viewport, + DIRECTMANIPULATION_READY, + DIRECTMANIPULATION_INERTIA); +} + +TEST(DirectManipulationTest, TestInertiaCamcelNotSentAtInertiaEnd) { + MockIDirectManipulationContent content; + MockWindowBindingHandlerDelegate delegate; + MockIDirectManipulationViewport viewport; + const int DISPLAY_WIDTH = 800; + const int DISPLAY_HEIGHT = 600; + auto owner = std::make_unique(nullptr); + owner->SetBindingHandlerDelegate(&delegate); + auto handler = + fml::MakeRefCounted(owner.get()); + int32_t device_id = (int32_t) reinterpret_cast(handler.get()); + // No need to mock the actual gesture, just start at the end. + EXPECT_CALL(viewport, GetViewportRect(_)) + .WillOnce(::testing::Invoke([DISPLAY_WIDTH, DISPLAY_HEIGHT](RECT* rect) { + rect->left = 0; + rect->top = 0; + rect->right = DISPLAY_WIDTH; + rect->bottom = DISPLAY_HEIGHT; + return S_OK; + })); + EXPECT_CALL(viewport, ZoomToRect(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, false)) + .WillOnce(::testing::Return(S_OK)); + EXPECT_CALL(delegate, OnPointerPanZoomEnd(device_id)); + handler->OnViewportStatusChanged((IDirectManipulationViewport*)&viewport, + DIRECTMANIPULATION_INERTIA, + DIRECTMANIPULATION_RUNNING); + // Have no change in pan between events. + EXPECT_CALL(content, GetContentTransform(_, 6)) + .WillOnce(::testing::Invoke( + [](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 140; + return S_OK; + })); + handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, + (IDirectManipulationContent*)&content); + EXPECT_CALL(content, GetContentTransform(_, 6)) + .WillOnce(::testing::Invoke( + [](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 140; + return S_OK; + })); + handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, + (IDirectManipulationContent*)&content); + // OnScrollInertiaCancel should not be called. + EXPECT_CALL(delegate, OnScrollInertiaCancel(device_id)).Times(0); + handler->OnViewportStatusChanged((IDirectManipulationViewport*)&viewport, + DIRECTMANIPULATION_READY, + DIRECTMANIPULATION_INERTIA); +} + } // namespace testing } // namespace flutter diff --git a/shell/platform/windows/flutter_windows_view.cc b/shell/platform/windows/flutter_windows_view.cc index aefff5d522492..9f6a184e92e8c 100644 --- a/shell/platform/windows/flutter_windows_view.cc +++ b/shell/platform/windows/flutter_windows_view.cc @@ -264,6 +264,11 @@ void FlutterWindowsView::OnScroll(double x, device_id); } +void FlutterWindowsView::OnScrollInertiaCancel(int32_t device_id) { + PointerLocation point = binding_handler_->GetPrimaryPointerLocation(); + SendScrollInertiaCancel(device_id, point.x, point.y); +} + void FlutterWindowsView::OnUpdateSemanticsEnabled(bool enabled) { engine_->UpdateSemanticsEnabled(enabled); } @@ -500,6 +505,17 @@ void FlutterWindowsView::SendScroll(double x, SendPointerEventWithData(event, state); } +void FlutterWindowsView::SendScrollInertiaCancel(int32_t device_id, double x, double y) { + auto state = GetOrCreatePointerState(kFlutterPointerDeviceKindTrackpad, device_id); + + FlutterPointerEvent event = {}; + event.x = x; + event.y = y; + event.signal_kind = FlutterPointerSignalKind::kFlutterPointerSignalKindScrollInertiaCancel; + SetEventPhaseFromCursorButtonState(&event, state); + SendPointerEventWithData(event, state); +} + void FlutterWindowsView::SendPointerEventWithData( const FlutterPointerEvent& event_data, PointerState* state) { diff --git a/shell/platform/windows/flutter_windows_view.h b/shell/platform/windows/flutter_windows_view.h index 45dc6fdb6a40c..1177883b64e47 100644 --- a/shell/platform/windows/flutter_windows_view.h +++ b/shell/platform/windows/flutter_windows_view.h @@ -180,6 +180,9 @@ class FlutterWindowsView : public WindowBindingHandlerDelegate, FlutterPointerDeviceKind device_kind, int32_t device_id) override; + // |WindowBindingHandlerDelegate| + void OnScrollInertiaCancel(int32_t device_id) override; + // |WindowBindingHandlerDelegate| virtual void OnUpdateSemanticsEnabled(bool enabled) override; @@ -331,6 +334,11 @@ class FlutterWindowsView : public WindowBindingHandlerDelegate, FlutterPointerDeviceKind device_kind, int32_t device_id); + // Reports scroll inertia cancel events to Flutter engine. + void SendScrollInertiaCancel(int32_t device_id, + double x, + double y); + // Creates a PointerState object unless it already exists. PointerState* GetOrCreatePointerState(FlutterPointerDeviceKind device_kind, int32_t device_id); diff --git a/shell/platform/windows/testing/mock_window_binding_handler_delegate.h b/shell/platform/windows/testing/mock_window_binding_handler_delegate.h index a7ad72cbe2623..03534b2e5ecfd 100644 --- a/shell/platform/windows/testing/mock_window_binding_handler_delegate.h +++ b/shell/platform/windows/testing/mock_window_binding_handler_delegate.h @@ -60,6 +60,7 @@ class MockWindowBindingHandlerDelegate : public WindowBindingHandlerDelegate { int, FlutterPointerDeviceKind, int32_t)); + MOCK_METHOD1(OnScrollInertiaCancel, void(int32_t)); MOCK_METHOD0(OnPlatformBrightnessChanged, void()); MOCK_METHOD1(UpdateHighContrastEnabled, void(bool enabled)); }; diff --git a/shell/platform/windows/window_binding_handler_delegate.h b/shell/platform/windows/window_binding_handler_delegate.h index 38569fda296bb..485fe4384f3cc 100644 --- a/shell/platform/windows/window_binding_handler_delegate.h +++ b/shell/platform/windows/window_binding_handler_delegate.h @@ -122,6 +122,10 @@ class WindowBindingHandlerDelegate { FlutterPointerDeviceKind device_kind, int32_t device_id) = 0; + // Notifies delegate that scroll inertia should be cancelled. + // Typically called by DirectManipulationEventHandler + virtual void OnScrollInertiaCancel(int32_t device_id) = 0; + // Notifies delegate that the Flutter semantics tree should be enabled or // disabled. virtual void OnUpdateSemanticsEnabled(bool enabled) = 0; From f439be2ac2ee5339e0a07fc40767235b54deca17 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Sun, 16 Oct 2022 20:36:16 -0400 Subject: [PATCH 2/4] Refactor device ID --- shell/platform/windows/direct_manipulation.cc | 14 ++++++++------ shell/platform/windows/direct_manipulation.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/shell/platform/windows/direct_manipulation.cc b/shell/platform/windows/direct_manipulation.cc index d0933fa5a9d19..8f743e0bf7d6d 100644 --- a/shell/platform/windows/direct_manipulation.cc +++ b/shell/platform/windows/direct_manipulation.cc @@ -24,6 +24,10 @@ namespace flutter { +int32_t DirectManipulationEventHandler::GetDeviceId() { + return (int32_t) reinterpret_cast(this); +} + STDMETHODIMP DirectManipulationEventHandler::QueryInterface(REFIID iid, void** ppv) { if ((iid == IID_IUnknown) || @@ -50,8 +54,7 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged( if (!during_synthesized_reset_) { // Not a false event. if (owner_->binding_handler_delegate) { - owner_->binding_handler_delegate->OnPointerPanZoomStart( - (int32_t) reinterpret_cast(this)); + owner_->binding_handler_delegate->OnPointerPanZoomStart(GetDeviceId()); } } } @@ -60,12 +63,11 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged( last_pan_delta_x_ = 0.0; last_pan_delta_y_ = 0.0; if (owner_->binding_handler_delegate) { - owner_->binding_handler_delegate->OnPointerPanZoomEnd( - (int32_t) reinterpret_cast(this)); + owner_->binding_handler_delegate->OnPointerPanZoomEnd(GetDeviceId()); } } else if (previous == DIRECTMANIPULATION_INERTIA) { if (owner_->binding_handler_delegate && std::max(std::abs(last_pan_delta_x_), std::abs(last_pan_delta_y_)) > 0.01) { - owner_->binding_handler_delegate->OnScrollInertiaCancel((int32_t) reinterpret_cast(this)); + owner_->binding_handler_delegate->OnScrollInertiaCancel(GetDeviceId()); } // Need to reset the content transform to its original position // so that we are ready for the next gesture. @@ -123,7 +125,7 @@ HRESULT DirectManipulationEventHandler::OnContentUpdated( last_pan_y_ = pan_y; if (owner_->binding_handler_delegate && !during_inertia_) { owner_->binding_handler_delegate->OnPointerPanZoomUpdate( - (int32_t) reinterpret_cast(this), pan_x, pan_y, scale, 0); + GetDeviceId(), pan_x, pan_y, scale, 0); } } return S_OK; diff --git a/shell/platform/windows/direct_manipulation.h b/shell/platform/windows/direct_manipulation.h index d0b6abc0b1506..6c2331e51088b 100644 --- a/shell/platform/windows/direct_manipulation.h +++ b/shell/platform/windows/direct_manipulation.h @@ -106,6 +106,8 @@ class DirectManipulationEventHandler DIRECTMANIPULATION_INTERACTION_TYPE interaction) override; private: + // Unique identifier to associate with all gesture event updates. + int32_t GetDeviceId(); // Parent object, used to store the target for gesture event updates. DirectManipulationOwner* owner_; // We need to reset some parts of DirectManipulation after each gesture From 9b7431e9b73ba2770d8a45219b457a073a112783 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Thu, 20 Oct 2022 01:37:21 -0400 Subject: [PATCH 3/4] Apply formatter --- shell/platform/windows/direct_manipulation.cc | 4 +- shell/platform/windows/direct_manipulation.h | 3 +- .../windows/direct_manipulation_unittests.cc | 55 +++++++++---------- .../platform/windows/flutter_windows_view.cc | 10 +++- shell/platform/windows/flutter_windows_view.h | 4 +- 5 files changed, 39 insertions(+), 37 deletions(-) diff --git a/shell/platform/windows/direct_manipulation.cc b/shell/platform/windows/direct_manipulation.cc index 8f743e0bf7d6d..af1d8c82d4c32 100644 --- a/shell/platform/windows/direct_manipulation.cc +++ b/shell/platform/windows/direct_manipulation.cc @@ -66,7 +66,9 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged( owner_->binding_handler_delegate->OnPointerPanZoomEnd(GetDeviceId()); } } else if (previous == DIRECTMANIPULATION_INERTIA) { - if (owner_->binding_handler_delegate && std::max(std::abs(last_pan_delta_x_), std::abs(last_pan_delta_y_)) > 0.01) { + if (owner_->binding_handler_delegate && + (std::max)(std::abs(last_pan_delta_x_), std::abs(last_pan_delta_y_)) > + 0.01) { owner_->binding_handler_delegate->OnScrollInertiaCancel(GetDeviceId()); } // Need to reset the content transform to its original position diff --git a/shell/platform/windows/direct_manipulation.h b/shell/platform/windows/direct_manipulation.h index 6c2331e51088b..e9aef840fdafa 100644 --- a/shell/platform/windows/direct_manipulation.h +++ b/shell/platform/windows/direct_manipulation.h @@ -114,7 +114,8 @@ class DirectManipulationEventHandler // A flag is needed to ensure that false events created as the reset occurs // are not sent to the flutter framework. bool during_synthesized_reset_ = false; - // Store whether current events are from synthetic inertia rather than user input. + // Store whether current events are from synthetic inertia rather than user + // input. bool during_inertia_ = false; // Store the difference between the last pan offsets to determine if inertia // has been cancelled in the middle of an animation. diff --git a/shell/platform/windows/direct_manipulation_unittests.cc b/shell/platform/windows/direct_manipulation_unittests.cc index 1158e330abe57..1d03a0396ddde 100644 --- a/shell/platform/windows/direct_manipulation_unittests.cc +++ b/shell/platform/windows/direct_manipulation_unittests.cc @@ -287,26 +287,25 @@ TEST(DirectManipulationTest, TestInertiaCancelSentForUserCancel) { DIRECTMANIPULATION_RUNNING); // Have pan_y change by 10 between inertia updates. EXPECT_CALL(content, GetContentTransform(_, 6)) - .WillOnce(::testing::Invoke( - [](float* transform, DWORD size) { - transform[0] = 1; - transform[4] = 0; - transform[5] = 100; - return S_OK; - })); + .WillOnce(::testing::Invoke([](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 100; + return S_OK; + })); handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, (IDirectManipulationContent*)&content); EXPECT_CALL(content, GetContentTransform(_, 6)) - .WillOnce(::testing::Invoke( - [](float* transform, DWORD size) { - transform[0] = 1; - transform[4] = 0; - transform[5] = 110; - return S_OK; - })); + .WillOnce(::testing::Invoke([](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 110; + return S_OK; + })); handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, (IDirectManipulationContent*)&content); - // This looks like an interruption in the middle of synthetic inertia because of user input. + // This looks like an interruption in the middle of synthetic inertia because + // of user input. EXPECT_CALL(delegate, OnScrollInertiaCancel(device_id)); handler->OnViewportStatusChanged((IDirectManipulationViewport*)&viewport, DIRECTMANIPULATION_READY, @@ -341,23 +340,21 @@ TEST(DirectManipulationTest, TestInertiaCamcelNotSentAtInertiaEnd) { DIRECTMANIPULATION_RUNNING); // Have no change in pan between events. EXPECT_CALL(content, GetContentTransform(_, 6)) - .WillOnce(::testing::Invoke( - [](float* transform, DWORD size) { - transform[0] = 1; - transform[4] = 0; - transform[5] = 140; - return S_OK; - })); + .WillOnce(::testing::Invoke([](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 140; + return S_OK; + })); handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, (IDirectManipulationContent*)&content); EXPECT_CALL(content, GetContentTransform(_, 6)) - .WillOnce(::testing::Invoke( - [](float* transform, DWORD size) { - transform[0] = 1; - transform[4] = 0; - transform[5] = 140; - return S_OK; - })); + .WillOnce(::testing::Invoke([](float* transform, DWORD size) { + transform[0] = 1; + transform[4] = 0; + transform[5] = 140; + return S_OK; + })); handler->OnContentUpdated((IDirectManipulationViewport*)&viewport, (IDirectManipulationContent*)&content); // OnScrollInertiaCancel should not be called. diff --git a/shell/platform/windows/flutter_windows_view.cc b/shell/platform/windows/flutter_windows_view.cc index 9f6a184e92e8c..e212b6cf6140a 100644 --- a/shell/platform/windows/flutter_windows_view.cc +++ b/shell/platform/windows/flutter_windows_view.cc @@ -505,13 +505,17 @@ void FlutterWindowsView::SendScroll(double x, SendPointerEventWithData(event, state); } -void FlutterWindowsView::SendScrollInertiaCancel(int32_t device_id, double x, double y) { - auto state = GetOrCreatePointerState(kFlutterPointerDeviceKindTrackpad, device_id); +void FlutterWindowsView::SendScrollInertiaCancel(int32_t device_id, + double x, + double y) { + auto state = + GetOrCreatePointerState(kFlutterPointerDeviceKindTrackpad, device_id); FlutterPointerEvent event = {}; event.x = x; event.y = y; - event.signal_kind = FlutterPointerSignalKind::kFlutterPointerSignalKindScrollInertiaCancel; + event.signal_kind = + FlutterPointerSignalKind::kFlutterPointerSignalKindScrollInertiaCancel; SetEventPhaseFromCursorButtonState(&event, state); SendPointerEventWithData(event, state); } diff --git a/shell/platform/windows/flutter_windows_view.h b/shell/platform/windows/flutter_windows_view.h index 1177883b64e47..6075903309479 100644 --- a/shell/platform/windows/flutter_windows_view.h +++ b/shell/platform/windows/flutter_windows_view.h @@ -335,9 +335,7 @@ class FlutterWindowsView : public WindowBindingHandlerDelegate, int32_t device_id); // Reports scroll inertia cancel events to Flutter engine. - void SendScrollInertiaCancel(int32_t device_id, - double x, - double y); + void SendScrollInertiaCancel(int32_t device_id, double x, double y); // Creates a PointerState object unless it already exists. PointerState* GetOrCreatePointerState(FlutterPointerDeviceKind device_kind, From 7ea0f0ffc35c8c1605139efe3fe9994df82878b7 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Thu, 20 Oct 2022 09:24:54 -0400 Subject: [PATCH 4/4] Try to fix build error --- shell/platform/windows/direct_manipulation.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/platform/windows/direct_manipulation.cc b/shell/platform/windows/direct_manipulation.cc index af1d8c82d4c32..41ddf07b5acec 100644 --- a/shell/platform/windows/direct_manipulation.cc +++ b/shell/platform/windows/direct_manipulation.cc @@ -4,6 +4,8 @@ #include "flutter/fml/logging.h" +#include + #include "flutter/shell/platform/windows/direct_manipulation.h" #include "flutter/shell/platform/windows/window.h" #include "flutter/shell/platform/windows/window_binding_handler_delegate.h"