Skip to content

Commit 7d7fe49

Browse files
committed
Attempt flutter#1 to fix CI failures
1 parent 694c31c commit 7d7fe49

15 files changed

+56
-22
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,9 @@ FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/plu
17161716
FILE: ../../../flutter/shell/platform/windows/client_wrapper/plugin_registrar_windows_unittests.cc
17171717
FILE: ../../../flutter/shell/platform/windows/cursor_handler.cc
17181718
FILE: ../../../flutter/shell/platform/windows/cursor_handler.h
1719+
FILE: ../../../flutter/shell/platform/windows/direct_manipulation.cc
1720+
FILE: ../../../flutter/shell/platform/windows/direct_manipulation.h
1721+
FILE: ../../../flutter/shell/platform/windows/direct_manipulation_unittests.cc
17191722
FILE: ../../../flutter/shell/platform/windows/display_helper_winuwp.cc
17201723
FILE: ../../../flutter/shell/platform/windows/display_helper_winuwp.h
17211724
FILE: ../../../flutter/shell/platform/windows/dpi_utils_win32.cc

lib/web_ui/lib/src/engine/pointer_converter.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,11 @@ class PointerDataConverter {
613613
);
614614
_pointers.remove(device);
615615
break;
616+
case ui.PointerChange.flowStart:
617+
case ui.PointerChange.flowUpdate:
618+
case ui.PointerChange.flowEnd:
619+
// Pointer flow events are not gemerated on web
620+
break;
616621
}
617622
} else {
618623
switch (signalKind) {

shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ - (void)surfaceUpdated:(BOOL)appeared;
121121
- (void)performOrientationUpdate:(UIInterfaceOrientationMask)new_preferences;
122122
- (void)handlePressEvent:(FlutterUIPressProxy*)press
123123
nextAction:(void (^)())next API_AVAILABLE(ios(13.4));
124-
- (void)scrollEvent:(UIPanGestureRecognizer*)recognizer;
124+
- (void)panEvent:(UIPanGestureRecognizer*)recognizer;
125125
- (void)updateViewportMetrics;
126126
- (void)onUserSettingsChanged:(NSNotification*)notification;
127127
- (void)applicationWillTerminate:(NSNotification*)notification;
@@ -1020,7 +1020,7 @@ - (void)testMouseSupport API_AVAILABLE(ios(13.4)) {
10201020
id mockPanGestureRecognizer = OCMClassMock([UIPanGestureRecognizer class]);
10211021
XCTAssertNotNil(mockPanGestureRecognizer);
10221022

1023-
[vc scrollEvent:mockPanGestureRecognizer];
1023+
[vc panEvent:mockPanGestureRecognizer];
10241024

10251025
[[[self.mockEngine verify] ignoringNonObjectArgs]
10261026
dispatchPointerDataPacket:std::make_unique<flutter::PointerDataPacket>()];

shell/platform/fuchsia/flutter/platform_view.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,11 @@ bool PlatformView::OnHandlePointerEvent(
378378
FML_DLOG(ERROR) << "Received hover event for down pointer.";
379379
}
380380
break;
381+
case flutter::PointerData::Change::kFlowStart:
382+
case flutter::PointerData::Change::kFlowUpdate:
383+
case flutter::PointerData::Change::kFlowEnd:
384+
FML_DLOG(ERROR) << "Unexpectedly received pointer flow event";
385+
break;
381386
}
382387

383388
auto packet = std::make_unique<flutter::PointerDataPacket>(1);

shell/platform/windows/BUILD.gn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ source_set("uwptool_utils") {
352352
"uwptool_utils.h",
353353
]
354354

355+
defines = [ "_SILENCE_CLANG_COROUTINE_MESSAGE" ]
356+
355357
deps = [ ":string_conversion" ]
356358

357359
defines = [ "_SILENCE_CLANG_COROUTINE_MESSAGE" ]
@@ -370,6 +372,8 @@ executable("uwptool") {
370372
]
371373
}
372374

375+
defines = [ "_SILENCE_CLANG_COROUTINE_MESSAGE" ]
376+
373377
sources = [ "uwptool_main.cc" ]
374378
deps = [
375379
":string_conversion",

shell/platform/windows/direct_manipulation.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ DirectManipulationOwner::DirectManipulationOwner(WindowWin32* window)
119119
int DirectManipulationOwner::Init(unsigned int width, unsigned int height) {
120120
HRESULT hr = CoCreateInstance(
121121
CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER,
122-
IID_IDirectManipulationManager, manager_.put_void());
122+
IID_IDirectManipulationManager, &manager_);
123123
if (FAILED(hr)) {
124124
FML_LOG(ERROR)
125125
<< "CoCreateInstance(CLSID_DirectManipulationManager) failed";
@@ -128,7 +128,7 @@ int DirectManipulationOwner::Init(unsigned int width, unsigned int height) {
128128
}
129129

130130
hr = manager_->GetUpdateManager(IID_IDirectManipulationUpdateManager,
131-
updateManager_.put_void());
131+
&updateManager_);
132132
if (FAILED(hr)) {
133133
FML_LOG(ERROR) << "GetUpdateManager failed";
134134
manager_ = nullptr;
@@ -138,7 +138,7 @@ int DirectManipulationOwner::Init(unsigned int width, unsigned int height) {
138138

139139
hr = manager_->CreateViewport(nullptr, window_->GetWindowHandle(),
140140
IID_IDirectManipulationViewport,
141-
viewport_.put_void());
141+
&viewport_);
142142
if (FAILED(hr)) {
143143
FML_LOG(ERROR) << "CreateViewport failed";
144144
manager_ = nullptr;

shell/platform/windows/direct_manipulation.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "flutter/fml/memory/ref_counted.h"
99

10-
#include <winrt/base.h>
10+
#include <wrl/client.h>
1111
#include "directmanipulation.h"
1212

1313
namespace flutter {
@@ -32,9 +32,9 @@ class DirectManipulationOwner {
3232
private:
3333
WindowWin32* window_;
3434
DWORD viewportHandlerCookie_;
35-
winrt::com_ptr<IDirectManipulationManager> manager_;
36-
winrt::com_ptr<IDirectManipulationUpdateManager> updateManager_;
37-
winrt::com_ptr<IDirectManipulationViewport> viewport_;
35+
Microsoft::WRL::ComPtr<IDirectManipulationManager> manager_;
36+
Microsoft::WRL::ComPtr<IDirectManipulationUpdateManager> updateManager_;
37+
Microsoft::WRL::ComPtr<IDirectManipulationViewport> viewport_;
3838
fml::RefPtr<DirectManipulationEventHandler> handler_;
3939
};
4040

shell/platform/windows/flutter_window_win32.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,11 @@ gfx::NativeViewAccessible FlutterWindowWin32::GetNativeViewAccessible() {
263263
return binding_handler_delegate_->GetNativeViewAccessible();
264264
}
265265

266+
PointerLocation FlutterWindowWin32::GetPrimaryPointerLocation() {
267+
POINT point;
268+
GetCursorPos(&point);
269+
ScreenToClient(GetWindowHandle(), &point);
270+
return {(size_t)point.x, (size_t)point.y};
271+
}
272+
266273
} // namespace flutter

shell/platform/windows/flutter_window_win32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class FlutterWindowWin32 : public WindowWin32, public WindowBindingHandler {
133133
size_t row_bytes,
134134
size_t height) override;
135135

136+
PointerLocation GetPrimaryPointerLocation() override;
137+
136138
private:
137139
// A pointer to a FlutterWindowsView that can be used to update engine
138140
// windowing and input state.

shell/platform/windows/flutter_window_winuwp.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,4 +392,10 @@ bool FlutterWindowWinUWP::OnBitmapSurfaceUpdated(const void* allocation,
392392
return false;
393393
}
394394

395+
PointerLocation FlutterWindowWinUWP::GetPrimaryPointerLocation() {
396+
auto point = window_.PointerPosition();
397+
auto bounds = window_.Bounds();
398+
return {static_cast<size_t>(point.X - bounds.X), static_cast<size_t>(point.Y - bounds.Y)};
399+
}
400+
395401
} // namespace flutter

0 commit comments

Comments
 (0)