Skip to content

gdk3: Interpolate scroll events to screen refresh, part 2 of 4

Yariv requested to merge yarivb/gtk:gdk-3-event-interpolation-part-2 into gtk-3-24

TLDR

This is the second part in an MR series aimed at solving jitter in animation based on continuous input. See #2025 for details about the issue, and !1117 for a general description of the solution.

Depends on, and includes, !1559

Continued in !1561

What it does

Add GdkEventHistory - a container for keeping the recent history of input events. While any input event can be kept in this container, in this MR only precise scroll events are supported.

Rational

We have to keep a history of recent input events in order to be able to interpolate them.

Each instance of GdkEventHistory holds a single event sequence, from inception to termination. As an example, for a touchpad scroll, swipe or pinch gesture a single GdkEventHistory instance would be enough. However for touchscreen events there would be a separate instance of GdkEventHistory for each active finger.

GdkEventHistory is responsible for accumulating relative properties (see !1559) in order to convert them to absolute ones. It also does the actual interpolation, and converts the interpolated properties back to relative ones where needed.

Edited by Yariv

Merge request reports