Sitelet https://github.com/androidx/androidx/pull/898
Skip to content

fix:AndroidComposeView reads previous MotionEvent after recycling it - #898

Open
TestPlanB wants to merge 1 commit into
androidx:androidx-mainfrom
TestPlanB:androidx-main
Open

TestPlanB wants to merge 1 commit into
androidx:androidx-mainfrom
TestPlanB:androidx-main

Conversation

@TestPlanB

Copy link
Copy Markdown

Proposed Changes

  • Avoid reading previousMotionEvent after it has been recycled.
  • Use the cached lastEvent for hover-exit / down-event detection.
  • Add a regression test for the mouse down path after hover exit.

Testing

AndroidPointerInputTest#mousePress_afterHoverExit_doesNotReadPreviousMotionEventAfterRecycle

It verifies that when AndroidComposeView has a cached ACTION_HOVER_EXIT and then receives a mouse ACTION_DOWN , Compose does not read the old MotionEvent after recycling it.

Issues Fixed

Fixes: https://issuetracker.google.com/issues/538645026

@TestPlanB

Copy link
Copy Markdown
Author

Could you please help review this patch? Thanks a lot. @codingjeremy

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant