Enable hover by default for desktop shells (flutter/engine#8991)

Fixes flutter/flutter#32835
This commit is contained in:
stuartmorgan
2019-05-16 20:12:03 -04:00
committed by GitHub
parent c0a0ef289e
commit 5c4c8d9f27
4 changed files with 4 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ FLUTTER_EXPORT
/**
* The style of mouse tracking to use for the view. Defaults to
* FlutterMouseTrackingModeNone.
* FlutterMouseTrackingModeInKeyWindow.
*/
@property(nonatomic) FlutterMouseTrackingMode mouseTrackingMode;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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);