From 54166ee36c8bd4efd453e7ce44fd3e1813284082 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Thu, 20 Oct 2022 22:13:11 +0200 Subject: [PATCH] [macOS] Fix mouse cursor being replaced by AppKit (flutter/engine#36283) --- .../darwin/macos/framework/Source/FlutterView.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm index 6407cb27882..30c0a4495ac 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm @@ -114,6 +114,15 @@ return YES; } +- (void)cursorUpdate:(NSEvent*)event { + // When adding/removing views AppKit will schedule call to current hit-test view + // cursorUpdate: at the end of frame to determine possible cursor change. If + // the view doesn't implement cursorUpdate: AppKit will set the default (arrow) cursor + // instead. This would replace the cursor set by FlutterMouseCursorPlugin. + // Empty cursorUpdate: implementation prevents this behavior. + // https://github.com/flutter/flutter/issues/111425 +} + - (void)viewDidChangeBackingProperties { [super viewDidChangeBackingProperties]; // Force redraw