Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hover support for mouse pointers. #24830

Merged
merged 9 commits into from Jan 29, 2019

Conversation

gspencergoog
Copy link
Contributor

This implements support for hovering mouse pointers, so that mice connected to Android devices, and ChromeOS devices running Android apps will work properly.

It teaches flutter_test about hover events, which required changing how they are created and used.

Also modifies AnnotatedRegion to allow a region that can be located someplace other than just the origin.

Along with tests for all of the above.

This code needs flutter/engine#6961 in order to actually receive hover events, but doesn't require it to compile.

Fixes #5504

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: gestures flutter/packages/flutter/gestures repository. labels Nov 29, 2018
@Hixie
Copy link
Contributor

Hixie commented Jan 10, 2019

This seems mostly fine but one major issue I see is that it assumes that there's only one mouse. We should track each pointer separately, any number of them could be mice.

@gspencergoog
Copy link
Contributor Author

Oooh, good point. OK, I've added support for multiple pointers.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments from my first "let's understand what this PR does" pass. Will take another, closer look shortly.

packages/flutter/lib/src/gestures/binding.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/widgets/basic.dart Show resolved Hide resolved
packages/flutter/test/gestures/mouse_tracking_test.dart Outdated Show resolved Hide resolved
packages/flutter_test/lib/src/controller.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/binding.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/layer.dart Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/mouse_tracking.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/gestures/events.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog merged commit 1811d57 into flutter:master Jan 29, 2019
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this pull request Feb 12, 2019
This implements support for hovering mouse pointers, so that mice connected to Android devices, and ChromeOS devices running Android apps will work properly.

It teaches flutter_test about hover events, which required changing how they are created and used.

Also modifies AnnotatedRegion to allow a region that can be located someplace other than just the origin.

Along with tests for all of the above.

Fixes flutter#5504
@gspencergoog gspencergoog deleted the hover branch February 12, 2019 17:35
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-chromebook Chromebook applications specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mouse Hover Support
5 participants