This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree 1 file changed +8
-2
lines changed
shell/platform/darwin/macos/framework/Source 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 30
30
static constexpr int32_t kMousePointerDeviceId = 0 ;
31
31
static constexpr int32_t kPointerPanZoomDeviceId = 1 ;
32
32
33
+ // A trackpad touch following inertial scrolling should cause an inertia cancel
34
+ // event to be issued. Use a window of 50 milliseconds after the scroll to account
35
+ // for delays in event propagation observed in macOS Ventura.
36
+ static constexpr double kTrackpadTouchInertiaCancelWindowMs = 0.050 ;
37
+
33
38
/* *
34
39
* State tracking for mouse events, to adapt between the events coming from the system and the
35
40
* events that the embedding API expects.
@@ -842,8 +847,9 @@ - (void)swipeWithEvent:(NSEvent*)event {
842
847
- (void )touchesBeganWithEvent : (NSEvent *)event {
843
848
NSTouch * touch = event.allTouches .anyObject ;
844
849
if (touch != nil ) {
845
- if ((event.timestamp - _mouseState.last_scroll_momentum_changed_time ) < 0.050 ) {
846
- // The trackpad has been touched within 50 ms following a scroll momentum event.
850
+ if ((event.timestamp - _mouseState.last_scroll_momentum_changed_time ) <
851
+ kTrackpadTouchInertiaCancelWindowMs ) {
852
+ // The trackpad has been touched following a scroll momentum event.
847
853
// A scroll inertia cancel message should be sent to the framework.
848
854
NSPoint locationInView = [self .flutterView convertPoint: event.locationInWindow fromView: nil ];
849
855
NSPoint locationInBackingCoordinates =
You can’t perform that action at this time.
0 commit comments