这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Hagb
Copy link
Contributor

@Hagb Hagb commented Jan 10, 2025

It fixes the problem that, when the touchscreen/stylus sampling rate is higher than the screen refresh rate, multiple points from the touchscreen/stylus are batched into a single MotionEvent object with extra latency, and all points of this object except the most current one are ignored.

For reference:

In the following samples, strokes were drawn with stylus (whose sampling rate is 240Hz), and the FPS is 60Hz. Red points and blue strokes were presented by the "show taps" option in developer options, and the green strokes were presented by xournal++ (xournalpp package in termux x11 repo). Before the patch was applied, 3 of every 4 points were ignored by termux-x11.

before the patch after the patch
before after
before (without  show taps ) after (without  show taps )

and reduce latency

It fixes the problem that, when the touchscreen/stylus sampling rate is
higher than the screen refresh rate, multiple points from the
touchscreen/stylus are batched into a single MotionEvent object with
extra latency, and all points of this object except the most current one
are ignored.

For reference:
- https://developer.android.com/develop/ui/views/touch-and-input/stylus-input/advanced-stylus-features#rendering
- https://developer.android.com/reference/android/view/MotionEvent#batching
@twaik twaik merged commit a461e13 into termux:master Jan 12, 2025
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.

2 participants