Open Bug 1731250 Opened 3 years ago Updated 3 years ago

Improve smooth scrolling with touchpad when scrolling slowly

Categories

(Core :: Panning and Zooming, enhancement)

Firefox 92
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: mystiquewolf, Unassigned)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

  1. Open some site in both Firefox and Chrome
  2. Scroll slowly with a touchpad, barely moving your fingers

Actual results:

TL;DR: See Screencast

In Firefox: Scroll is choppy, page either stays without moving, or it moves abruptly, albeit smooth
In Chrome: Scroll is not choppy, you're free to scroll with whatever speed you want and that are no smooth jumps.

Expected results:

Smooth scroll should have jumps when scrolling slowly with a touchpad.

And here's the screencast: https://youtu.be/j9Qx-iU237s

The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core
Keywords: perf

I don't believe this is a performance issue, if you scroll a little bit faster it doesn't get choppy. I mean, it's still smooth, but in periods. I think it's hardcoded to behave that way. However i'm not a Firefox developer so don't know the internals.

Does running Firefox with MOZ_USE_XINPUT2=1 in the environment help?

Wow YES! Why this isn't in Release already??

On second thought - is this only an X11 technology and if so - is there any Wayland equivalent? We need to have that kind of smoothness in Firefox ASAP.

Nevermind i guess i found the blocking bug - Bug 1207700. Not sure if it's a blocker on KDE too but there is still good news - on Wayland even without MOZ_USE_XINPUT2=1 it works about the same.

Yep, you found the relevant issue.

To explain a bit about the connection between XInput2 and these symptoms: with XInput2 disabled, the events Firefox receives from GTK during touchpad scrolling have the input source GDK_SOURCE_MOUSE, suggesting that GTK/X11 is emulating a mouse wheel, with discrete "ticks" after a certain distance moved on the touchpad. With XInput2 enabled, the input source becomes GDK_SOURCE_TOUCHPAD, and events are received more continuously, resulting in the smoother scrolling.

We tried to enable XInput2 by default but had to back it out due to regressions (bug 1660212). Based on this comment, it seems like the underlying issue is upstream in GTK/X11.

Wayland sends GDK_SOURCE_TOUCHPAD without having to enable anything special and is thus not affected.

Given the above, unfortunately the best advice we have for X11 users at this time is to enable XInput2 manually (via MOZ_USE_XINPUT2=1) if it doesn't break other aspects of the Firefox user experience. Hopefully, as people migrate from X11 to Wayland over time, this will become less and less of an issue.

I've seen Bug 1660212 on my machine and personally i much prefer it to the choppy scrolling. The other bug sounds more serious, i haven't tested it (i guess it needs a mouse not touchpad).

I wonder if Chrome experiences the same issues but have nevertheless chosen to use XInput2?

You need to log in before you can comment on or make changes to this bug.