[GTK3, GTK4] Animation based on smooth scroll events is jittery
This is a sub-issue of #2025, concerned only with GdkEvent
type GDK_SCROLL_SMOOTH
.
The issue
"Stick-to-finger" touchpad scrolling is jittery. The issue was observed when using an external Apple touchpad along with a standard 60Hz monitor. Note that this is not about kinetic (inertial) scroll, rather about touchpad scrolling without lifting the fingers.
Steps to reproduce
I am using a first-generation Apple external 'Trackpad'. This was done on a desktop computer with an Intel 'Skylake' CPU and integrated GPU. The same issue was observed when using a discreet AMD GPU. The issue can manifest on any setup - it is actually a matter of input rate vs display rate, see the parent issue (#2025) for details.
- Run gtk3-demo (or gtk4-demo)
- Click on the source tab of, say, the 'Foreign drawing' demo to view its source code
- Scroll using a 2-finger touchpad scroll
Current behavior
Scrolling is jittery.
Expected outcome
Scrolling should be smooth.
Version information
The desktop environment is GNOME Shell (v3.28.4) Wayland session on Ubuntu 18.04. The same issue exists on GTK4 (built from source) as well as the latest version of GTK v3.24 when building from source.
Additional information
To see the problem please view the following videos in full screen.
This is a recording of the jittery scroll: jitter_window
This is a recording of a smooth scroll session, taken after applying a proof-of-concept fix: smooth_window
The root cause
For explanation of the root cause please refer to the parent issue, see here #2025
Fixed by !1117