Skip to content

Conversation

@justinmc
Copy link
Contributor

@justinmc justinmc commented May 23, 2024

MouseRegion has three main listeners: onEnter, onExit, and onHover. All three work for a mouse cursor, but previously, only onHover worked for a hovering [1] stylus. This PR changes it so that all work for a hovering stylus. It does so at the low MouseTracker level.

stylus_hover_mouse

Fixes #148810

[1] By hovering stylus, I mean a stylus that is close but not in contact with the screen.

@justinmc justinmc self-assigned this May 23, 2024
@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label May 23, 2024
@justinmc justinmc mentioned this pull request May 23, 2024
@justinmc justinmc requested a review from dkwingsmt May 23, 2024 23:57
@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. labels May 24, 2024

final Matrix4 translate10by20 = Matrix4.translationValues(10, 20, 0);

test('should detect enter, hover, and exit from Added, Hover, and Removed events', () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hard to read the diff here, but all I did was wrap this in a for so that it's run once for mouse gestures and once for stylus.

@justinmc justinmc marked this pull request as ready for review May 24, 2024 22:48
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #149006 at sha 1b94e50

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label May 24, 2024
@justinmc
Copy link
Contributor Author

The goldens look like nothing actually changed? I'll push a merge commit. It's suspicious that they're both text field things though (albeit CupertinoTextField strangely).

Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

LGTM, nice change! Thanks!

@justinmc justinmc merged commit 980b5a1 into flutter:master May 28, 2024
@justinmc justinmc deleted the stylus-hover branch May 28, 2024 17:39
@polina-c polina-c mentioned this pull request May 28, 2024
auto-submit bot pushed a commit that referenced this pull request May 28, 2024
Introduced by #149006

To repro run:

`flutter test /Users/polinach/_/flutter_dev/packages/flutter/test/material/text_button_test.dart --dart-define LEAK_TR`

<img width="268" alt="Screenshot 2024-05-28 at 11 50 33�AM" src="https://github.com/flutter/flutter/assets/12115586/c1a1bf5e-4df4-4819-b897-b09021d3a07a">
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 29, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 29, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 29, 2024
flutter/flutter@a1a33e6...c85fa6a

2024-05-29 [email protected] Clean leak in editable_text_test.dart. (flutter/flutter#149223)
2024-05-29 [email protected] Add tests for animated_switcher.0.dart API example. (flutter/flutter#149180)
2024-05-29 [email protected] Manual roll Flutter Engine from d0323905fc2f to b26e1b023cdb (16 revisions) (flutter/flutter#149220)
2024-05-29 [email protected] Change snack bar default hitTestBehavior to deferToChild when SnackBarThemeData.insetPadding is not null (flutter/flutter#148568)
2024-05-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "sliverGridDelegate mainAxisExtent add assert (#148470)" (flutter/flutter#149224)
2024-05-29 [email protected] sliverGridDelegate mainAxisExtent add assert (flutter/flutter#148470)
2024-05-29 [email protected] Fix `SearchAnchor` suggestions not refreshing after long API call (flutter/flutter#148767)
2024-05-28 [email protected] Add link to golden file test docs in the framework gardener guide (flutter/flutter#149207)
2024-05-28 [email protected] Remove opt out for CurvedAnimation. (flutter/flutter#147594)
2024-05-28 [email protected] Fix the RenderFlex.computeDryBaseline implementation to match computeDistanceToActualBaseline (flutter/flutter#149062)
2024-05-28 [email protected] Clean leaky test. (flutter/flutter#149199)
2024-05-28 [email protected] Change `android_plugin_new_output_dir_test.dart` test description (flutter/flutter#149198)
2024-05-28 [email protected] fix M2 InputDecorator suffix icon doesn't turn red on error (flutter/flutter#149161)
2024-05-28 [email protected] Add selectionOverlayBuilder in CupertinoDatePicker and CupertinoTimerâ�¦ (flutter/flutter#143079)
2024-05-28 [email protected] Mouse onEnter and onExit now support hovering stylus (flutter/flutter#149006)
2024-05-28 [email protected] Remove `TextEditingController` private member access (flutter/flutter#149042)
2024-05-28 [email protected] Roll Packages from b7bcb4b to a933c30 (1 revision) (flutter/flutter#149184)
2024-05-28 [email protected] Roll Flutter Engine from b1751088c7e9 to d0323905fc2f (2 revisions) (flutter/flutter#149169)
2024-05-28 [email protected] [tool] Use kebabCase directly (flutter/flutter#149150)
2024-05-28 [email protected] [wiki migration] Leftover wiki pages and links (flutter/flutter#148989)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request May 31, 2024
Hovering with a stylus will now behave similarly to hovering with a mouse. For example, hovering a button will show the button's hovered styling.
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request May 31, 2024
Introduced by flutter#149006

To repro run:

`flutter test /Users/polinach/_/flutter_dev/packages/flutter/test/material/text_button_test.dart --dart-define LEAK_TR`

<img width="268" alt="Screenshot 2024-05-28 at 11 50 33�AM" src="https://github.com/flutter/flutter/assets/12115586/c1a1bf5e-4df4-4819-b897-b09021d3a07a">
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hovering stylus

2 participants