Enable hover by default for desktop shells (flutter/engine#8991)
Fixes flutter/flutter#32835
This commit is contained in:
@@ -48,7 +48,7 @@ FLUTTER_EXPORT
|
||||
|
||||
/**
|
||||
* The style of mouse tracking to use for the view. Defaults to
|
||||
* FlutterMouseTrackingModeNone.
|
||||
* FlutterMouseTrackingModeInKeyWindow.
|
||||
*/
|
||||
@property(nonatomic) FlutterMouseTrackingMode mouseTrackingMode;
|
||||
|
||||
|
||||
@@ -204,6 +204,7 @@ static bool HeadlessOnMakeResourceCurrent(FLEViewController* controller) {
|
||||
static void CommonInit(FLEViewController* controller) {
|
||||
controller->_messageHandlers = [[NSMutableDictionary alloc] init];
|
||||
controller->_additionalKeyResponders = [[NSMutableOrderedSet alloc] init];
|
||||
controller->_mouseTrackingMode = FlutterMouseTrackingModeInKeyWindow;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder*)coder {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user