[SOLVED] Kinetic Scrolling on Linux?

I installed Arch Linux and sway on my Framework laptop.

It’s very smooth except two-finger scrolling on the touchpad. Coming from macOS I thought I had to accept that. I am like: For freedom you have to give up some macOS conveniences:

  • There is no inertia effect: if my two finger-touch leaves the touchpad while moving vertically, scrollling stops immediately, there is no delayed deceleration of scrolling

  • There is no overscroll effect: when scrollling to the top or to the bottom, scrolling stops abruptly, there is no bouncing-back effect

  • And the worst one: Scrolling is sometimes jumpy: when I move two fingers on the touchpad there can be some delay in scrolling before suddenly jumping about one-fourth of the screen, and this effect can repeat

This said, I accept this. Although I miss kinetic and smooth scrolling from my macOS experience.

However I discovered that some Linux users do seem to have smooth scrolling. One example: https://forums.linuxmint.com/viewtopic.php?t=350807 (he wants to disable smooth scrolling, for me it’s the oppositve).

I am hopeful now that my laptop is just wrongly configured.

Two questions:

  1. Do some Linux Framework users really have kinetic scrolling as described above (inertia, overscroll and smoothness)?

  2. Do you have some tips how to troubleshoot touchpad scrolling?

2 Likes

Hi. Although I think nothing comes close to the Mac touchpad experience I have to say I was surprised an am pleased by the experience I have with my framework on Ubuntu 21.10. it’s no as accurate as on a mac but I’m pretty sure the described effects are there. Especially inertia. I will give it a try later and let you know.

2 Likes

Hello, I do have kinetic scrolling, but this might be app-dependent. Firefox handles it beautifully, Electron does too, but this is on Windows. Speaking of arch, I think it might be not enabled, I found this forum post https://bbs.archlinux.org/viewtopic.php?id=266547

Thanks. I am using sway and it’s running on Wayland, not X11.

Now I’ve found the solution to the problem myself.

I am running XWayland, too, because CLion doesn’t understand Wayland. However then Firefox also runs under X11 and scrolling seems to be very bad under X11.

export MOZ_ENABLE_WAYLAND=1

in .bashrc solved the problem.

Thank you for the community for confirming that Framework users have smooth scrolling, so I went looking for a solution.

2 Likes

Can you explain this solution? Which DE are you on? Did this give you smooth scrolling for the entire desktop or just for Firefox? Thank you!

1 Like

It’s only for Firefox. If given the choice, Firefox prefers X11 to Wayland, but scrolling seems to be bad in X11. I am using sway, but I think setting the environment variable works for other window managers as well.

Just a note in case this helps someone else: I recently got my Framework laptop, copied my $HOME from my old laptop (where kinetic scrolling in Firefox/X11 worked fine), but found there was no kinetic scrolling in Firefox on my new laptop, and was confused for the better part of a week.

Today, just as I was about to post about it here, I remembered that Firefox on X11 requires MOZ_USE_XINPUT2=1 set in the environment to get kinetic scrolling to work. A simple way to do this is to drop a file in /etc/X11/Xsession.d/ that just contains export MOZ_USE_XINPUT2=1 in it. But of course I didn’t think to copy that file over from my old laptop. After taking care of this, all is well, and Firefox scrolling is all kinetic again.

3 Likes

Hello there, for me it didn’t work to set export MOZ_ENABLE_WAYLAND=1 in .bashrc or .zshrc (running manjaro Linux, it runs Xwayland).

What worked is setting the MOZ_ENABLE_WAYLAND=1 as Environment Variable for Firefox in KDE. For that, you have to right click on firefox in the Application Menu → Edit Application → Application → Environment Variables = MOZ_ENABLE_WAYLAND=1.

Just leaving it here, in case somebody has the same problem.

2 Likes

I am using i3 and sway on Fedora 37.

My sway config is below. I think that the kinetic scrolling is the natural_scroll enabled.

~/.config/sway/config

...
input "2362:628:PIXA3854:00_093A:0274_Touchpad" {
    click_method clickfinger
    natural_scroll enabled
    scroll_method two_finger
    tap disabled
}
...

And my i3 (X Window-based window manager) config is below. I think the kinetic scrolling is the Option "NaturalScrolling" "True".

/etc/X11/xorg.conf.d/40-trackpad.conf

# https://wayland.freedesktop.org/libinput/doc/latest/
# https://wiki.archlinux.org/title/Libinput
Section "InputClass"
        Identifier "libinput touchpad"
        Driver "libinput"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Option "Tapping" "False"
        Option "TappingDrag" "True"
        # Trackpad no longer has middle and right button areas and instead
        # two-finger click is a context click and three-finger click is a middle click
        # https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html#clickfinger-behavior
        Option "ClickMethod" "clickfinger"
        Option "NaturalScrolling" "True"
EndSection
2 Likes

@junaruga no, “natural scrolling” is a setting that reverses the scrolling direction, usually useful/interesting when using a touchpad or touchscreen. Usually when you drag your fingers up on the pad, it will scroll up. “Natural scrolling” reverses this, so when you drag your fingers up, the content scrolls down.

“Kinetic scrolling” is when your scrolling motions have “momentum”; that is, when you release your fingers from the touchpad, the content keeps scrolling for a bit, and eventually slows down and stops. Scrolling “harder” will impart more momentum and cause this effect to be larger.

1 Like

It really depends on which input handler you are using.

Libinput does not support it yet, however, there is some WIP.

Synaptics seems to support it.

GTK applications need to support it, but they only work on touch devices by default.

QT apps are similiar, they could support it, but each app would have to implement it.

So in conclusion, depending on which graphics server you use, which application and which input handler you use, you may be lucky … or not.

Edit: Also see this unsolvable xorg problem.
Edit 2: Also see this wayland page.

@kelnos wrote:

“Natural scrolling” reverses this, so when you drag your fingers up, the content scrolls down.

Sorry, no, it’s the opposite.

Natural Scrolling Vs. Reverse Scrolling | Jesse Lee says:

Swipe fingers up […] content goes up […]

I always use edge scrolling versus two finger scrolling. My hand never leaves the keypad. I can scroll and move the cursor with thumb only.

No, what I said is correct. I said when you drag your fingers up the content scrolls down. The thing you linked says when you swipe your fingers up, the content goes up. Those are equivalent statements.

“Content scrolls down” means (to me anyway) that you move downward in the page. “Content goes up” means the same thing, just phrased differently, that the current bit of content that is visible will go upward – and the effect is that you scroll down.

Yeah if you say so. YOLO.

I learnt today: Never say “scroll” with “up” or “down”. It’s too damn confusing.

1 Like

Based on this and other answers, marking this resolved. But please feel free to continue exploring this. More data is good data.

1 Like

fyi I just got the Framework 16 Framework | Fix Consumer Electronics

After installing Ubuntu 24.04 I found that kinetic scrolling worked great in Firefox.

I installed Google Chrome by navigating to Google Chrome - The Fast & Secure Web Browser Built to be Yours and kinetic scrolling isn’t working for Chrome.

Went to chrome://flags/ and enabled Smooth scrolling but didn’t seem to do anything