Skip to content

Commit b6981a3

Browse files
Enable hover by default for desktop shells (flutter#8991)
Fixes flutter#32835
1 parent e94d352 commit b6981a3

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

shell/platform/darwin/macos/framework/Headers/FLEViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ FLUTTER_EXPORT
4848

4949
/**
5050
* The style of mouse tracking to use for the view. Defaults to
51-
* FlutterMouseTrackingModeNone.
51+
* FlutterMouseTrackingModeInKeyWindow.
5252
*/
5353
@property(nonatomic) FlutterMouseTrackingMode mouseTrackingMode;
5454

shell/platform/darwin/macos/framework/Source/FLEViewController.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ @implementation FLEViewController {
204204
static void CommonInit(FLEViewController* controller) {
205205
controller->_messageHandlers = [[NSMutableDictionary alloc] init];
206206
controller->_additionalKeyResponders = [[NSMutableOrderedSet alloc] init];
207+
controller->_mouseTrackingMode = FlutterMouseTrackingModeInKeyWindow;
207208
}
208209

209210
- (instancetype)initWithCoder:(NSCoder*)coder {

shell/platform/glfw/flutter_glfw.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct FlutterDesktopWindow {
8585
GLFWwindow* window;
8686

8787
// Whether or not to track mouse movements to send kHover events.
88-
bool hover_tracking_enabled = false;
88+
bool hover_tracking_enabled = true;
8989

9090
// The ratio of pixels per screen coordinate for the window.
9191
double pixels_per_screen_coordinate = 1.0;

shell/platform/glfw/public/flutter_glfw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ FlutterDesktopGetPluginRegistrar(FlutterDesktopWindowControllerRef controller,
9898
//
9999
// If hover is enabled, mouse movement will send hover events to the Flutter
100100
// engine, rather than only tracking the mouse while the button is pressed.
101-
// Defaults to off.
101+
// Defaults to on.
102102
FLUTTER_EXPORT void FlutterDesktopWindowSetHoverEnabled(
103103
FlutterDesktopWindowRef flutter_window,
104104
bool enabled);

0 commit comments

Comments
 (0)