Skip to content

Dispatch hover events to PlatformViewController#46124

Merged
cbracken merged 1 commit intoflutter:masterfrom
cbracken:platformlayer-hover
Dec 5, 2019
Merged

Dispatch hover events to PlatformViewController#46124
cbracken merged 1 commit intoflutter:masterfrom
cbracken:platformlayer-hover

Conversation

@cbracken
Copy link
Copy Markdown
Member

@cbracken cbracken commented Dec 5, 2019

This adds support to PlatformViewLayer for handling hover events. Prior to this, PlatformViewLayers only supported events forwarded by the gesture recognizers associated with the PlatformViewRenderBox. Hover events don't participate in gesture recognition and as such are dropped in GestureBinding. That said, hover event processing in platform views is expected for desktop and other platforms with hover event support.

This adds support for passing an optional MouseTrackerAnnotation to PlatformViewLayer. PlatformViewRenderBox populates this with a mouse tracker annotation that forwards hover events to PlatformViewController.dispatchPointerEvent() for handling by users.

@cbracken cbracken requested review from amirh and dkwingsmt December 5, 2019 00:02
@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Dec 5, 2019
Copy link
Copy Markdown
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, with suggestion on docs

Comment thread packages/flutter/lib/src/rendering/layer.dart Outdated
This adds support to PlatformViewLayer for handling hover events. Prior
to this, PlatformViewLayers only supported events forwarded by the
gesture recognizers associated with the PlatformViewRenderBox. Hover
events don't participate in gesture recognition and as such are dropped
in GestureBinding. That said, hover event processing in platform views
is expected for desktop and other platforms with hover event support.

This adds support for passing an optional MouseTrackerAnnotation to
PlatformViewLayer. PlatformViewRenderBox populates this with a mouse
tracker annotation that forwards hover events to
PlatformViewController.dispatchPointerEvent() for handling by users.
@cbracken cbracken force-pushed the platformlayer-hover branch from 6da9a30 to f6d9b48 Compare December 5, 2019 01:02
@cbracken cbracken merged commit fa0c49d into flutter:master Dec 5, 2019
@cbracken cbracken deleted the platformlayer-hover branch December 5, 2019 21:31
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants