Unbuffer MotionEvent objects for touch events to avoid ignoring points and reduce latency
#783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
MotionEventobject 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++ (
xournalpppackage in termux x11 repo). Before the patch was applied, 3 of every 4 points were ignored by termux-x11.