diff --git a/shell/platform/darwin/macos/framework/Source/FlutterView.mm b/shell/platform/darwin/macos/framework/Source/FlutterView.mm index 1eaf0d096449b..21a1115e73d73 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterView.mm @@ -107,7 +107,8 @@ - (void)didUpdateMouseCursor:(NSCursor*)cursor { // and will not restore it back. - (void)cursorUpdate:(NSEvent*)event { // Make sure to not override cursor when over a platform view. - NSView* hitTestView = [self hitTest:[self convertPoint:event.locationInWindow fromView:nil]]; + NSPoint mouseLocation = [[self superview] convertPoint:event.locationInWindow fromView:nil]; + NSView* hitTestView = [self hitTest:mouseLocation]; if (hitTestView != self) { return; } diff --git a/shell/platform/darwin/macos/framework/Source/FlutterViewTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterViewTest.mm index cc675171d8130..3c84116188392 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterViewTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterViewTest.mm @@ -110,7 +110,7 @@ - (void)set { EXPECT_TRUE(hitTestCalled); // The hit test coordinate should be in the window coordinate system. - EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 500))); + EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 100))); EXPECT_TRUE(cursor.setCalled); } @@ -155,6 +155,6 @@ - (void)set { EXPECT_TRUE(hitTestCalled); // The hit test coordinate should be in the window coordinate system. - EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 500))); + EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 100))); EXPECT_FALSE(cursor.setCalled); }