diff --git a/shell/platform/darwin/macos/framework/Headers/FLEViewController.h b/shell/platform/darwin/macos/framework/Headers/FLEViewController.h index c66cba2130a3d..d591ececa6f34 100644 --- a/shell/platform/darwin/macos/framework/Headers/FLEViewController.h +++ b/shell/platform/darwin/macos/framework/Headers/FLEViewController.h @@ -48,7 +48,7 @@ FLUTTER_EXPORT /** * The style of mouse tracking to use for the view. Defaults to - * FlutterMouseTrackingModeNone. + * FlutterMouseTrackingModeInKeyWindow. */ @property(nonatomic) FlutterMouseTrackingMode mouseTrackingMode; diff --git a/shell/platform/darwin/macos/framework/Source/FLEViewController.mm b/shell/platform/darwin/macos/framework/Source/FLEViewController.mm index 8c35e332ee14f..29bf82d377135 100644 --- a/shell/platform/darwin/macos/framework/Source/FLEViewController.mm +++ b/shell/platform/darwin/macos/framework/Source/FLEViewController.mm @@ -204,6 +204,7 @@ @implementation FLEViewController { static void CommonInit(FLEViewController* controller) { controller->_messageHandlers = [[NSMutableDictionary alloc] init]; controller->_additionalKeyResponders = [[NSMutableOrderedSet alloc] init]; + controller->_mouseTrackingMode = FlutterMouseTrackingModeInKeyWindow; } - (instancetype)initWithCoder:(NSCoder*)coder { diff --git a/shell/platform/glfw/flutter_glfw.cc b/shell/platform/glfw/flutter_glfw.cc index 5e33f6d4c62b1..1dd37f5f3a5fc 100644 --- a/shell/platform/glfw/flutter_glfw.cc +++ b/shell/platform/glfw/flutter_glfw.cc @@ -85,7 +85,7 @@ struct FlutterDesktopWindow { GLFWwindow* window; // Whether or not to track mouse movements to send kHover events. - bool hover_tracking_enabled = false; + bool hover_tracking_enabled = true; // The ratio of pixels per screen coordinate for the window. double pixels_per_screen_coordinate = 1.0; diff --git a/shell/platform/glfw/public/flutter_glfw.h b/shell/platform/glfw/public/flutter_glfw.h index 573c821346a51..f4c718fe8d24b 100644 --- a/shell/platform/glfw/public/flutter_glfw.h +++ b/shell/platform/glfw/public/flutter_glfw.h @@ -98,7 +98,7 @@ FlutterDesktopGetPluginRegistrar(FlutterDesktopWindowControllerRef controller, // // If hover is enabled, mouse movement will send hover events to the Flutter // engine, rather than only tracking the mouse while the button is pressed. -// Defaults to off. +// Defaults to on. FLUTTER_EXPORT void FlutterDesktopWindowSetHoverEnabled( FlutterDesktopWindowRef flutter_window, bool enabled);