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

Fix precise mouse wheel detection #1326

Merged
merged 1 commit into from
May 28, 2024

Conversation

MatkovIvan
Copy link
Member

@MatkovIvan MatkovIvan commented Apr 26, 2024

Fix precise mouse wheel detection that might cause missing animations

Fixes https://kotlinlang.slack.com/archives/C01D6HTPATV/p1713977814126099

Testing

Should be covered by existing tests + manually.

Release Notes

Fixes - Desktop

  • Fix possible scrolling without animation on some mouse models

@MatkovIvan MatkovIvan requested a review from igordmn April 26, 2024 15:36
@iamcalledrob
Copy link

For testing, the mouse which I encountered issues with was a Surface Precision Mouse paired by bluetooth to Windows 11.

@MatkovIvan MatkovIvan marked this pull request as ready for review May 27, 2024 11:29
Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Tested on:

  • Windows, Logitech mouse with precise scrolling enabled/disabled - scrolling is smooth
  • macOs touchpad - scrolling is smooth
  • macOs the same mouse - scrolling is rough (isn't animated, before and after the fix)

Regarding the last point - worth to consider always enabling animation (maybe later), we can run it undispatched, so the first frame can scroll to the target position.
Running animation undispatched probably can also simplify the code, it allows getting rid of shouldApplyImmediately.

I don't remember why we decided conditionally enable this, probably there were some unresponsiveness because of extra frames or dispatching nature of animation.

@MatkovIvan MatkovIvan merged commit c82dfa1 into jb-main May 28, 2024
6 checks passed
@MatkovIvan MatkovIvan deleted the ivan.matkov/fix-precise-wheel-detection branch May 28, 2024 10:34
MatkovIvan added a commit that referenced this pull request May 29, 2024
Fix precise mouse wheel detection that might cause missing animations

Fixes
https://kotlinlang.slack.com/archives/C01D6HTPATV/p1713977814126099

## Testing

Should be covered by existing tests + manually.

## Release Notes

### Fixes - Desktop
- Fix possible scrolling without animation on some mouse models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants