r/linux
•
u/mort96
•
Sep 26 '17
•
1
PSA for Firefox users: set MOZ_USE_XINPUT2=1 to enable macOS-like smooth scrolling
I've been annoyed for a while that Firefox only supports the kind of two finger scrolling where moving the fingers on the touch pad a decent amount emits a scroll wheel event. I just now found out that if you start Firefox with the environment variable MOZ_USE_XINPUT2 set to 1, it will use xinput 2, and support actual smooth touch pad scrolling.
I know this works for Firefox 55 or newer, but don't know the earliest version which supports it. I assume it will be enabled by default at some point, but it isn't yet in Firefox 58 (the current nightly).
Run this command:
echo export MOZ_USE_XINPUT2=1 | sudo tee /etc/profile.d/use-xinput2.sh
- Log out and back in.
- Firefox should now use xinput 2.
- (optional) Open Firefox and go to
about:preferences-> Advanced (orabout:preferences-> Browsing for Firefox Nightly), and uncheck "Use smooth scrolling". This disables the old style "smooth scrolling", which just causes an annoying delay when using xinput2 style scrolling imo.
5
u/Smaug_the_Tremendous Sep 26 '17
Fedora has had this by default for a while now. Don't know why the other distros don't.
4
u/iHateRollerCoaster Sep 06 '24
Information from a 7 year old thread just made the touchscreen on this new laptop work better lmaoooooo
Thank you op
1
u/jwintyo Apr 01 '25
Wow, still works. Thank you so much! I found the scrolling so annoying…
1
u/0x6e73 Sep 16 '25
8 yrs on and this post is still rocking it. Linux Mint 22.2 Cinnamon, Mozilla Firefox 142.0.1 was driving me nuts with touch pad 2 finger scroll acting like a scroll wheel!!!
this little tip sorted it!
thank you u/mort96
2
u/genpfault Sep 27 '17 edited Sep 27 '17
I've had issues with the XInput2 codepath where there seems to be a half-pixel gutter on the left-hand side of a maximized Firefox window: moving a high-DPI (2500) mouse to the far left and attempting to middle-click auto-scroll doesn't work reliably (as if the pointer isn't inside the window), but shifting right just a teensy bit (<1 px) lets it work.
I think it's caused by some layer of the software (Firefox? GTK? Something lower-level?) incorrectly rounding-/casting-to-
intthedoublemouse coordinates from XInput2.The clicks are 100% reliable without
MOZ_USE_XINPUT2=1.If anyone knows of an existing bug for this let me know.
2
u/FishyGlitcher Jan 25 '23
THANK YOU SO MUCH, IT WORKS BEAUTIFULLY, I LOVE U
2
u/[deleted] Feb 10 '23
i find it smoother without the 4th step
2
u/Lake333 Aug 01 '25
Eight years late but hopefully this helps some people for whom this tip may not work: Do as OP has said, but also then go to about:config and change "general.smoothScroll.msdPhysics.enabled" to true. It worked for me, but I don't understand why or how, and I can't guarantee it'll work for everyone. Good luck.
Edit bc I forgot: If anyone has any answers as to why the scrolling for Google sheets still sucks even when everything else works fine, do let me know please. Thanks!
1
u/Datante Jan 12 '24
This is amazing, thank you so much!
1
u/BrazenBunniez Mar 08 '24
This helped me loads with Kubuntu 22.04 and Firefox 125.
1
u/PickledNerd25 Apr 15 '24 edited Apr 15 '24
After 7 years, this is still not default with Firefox under x11, and still the only way to get smooth gestures. If anybody is wondering, this now enables also pinch to zoom, panning, and back/forth two fingers swiping with Firefox 124.
1
u/MrCookieAlex Jul 15 '24
6 years ago?!
this just fixed my issue
1
u/tf2player7 Jul 31 '24
Thanks! Was looking to slow down touchpad scroll, found this post and it also solved the problem of non functioning touchscreen scroll in Firefox on Linux Mint.
1
u/lonelyroom-eklaghor Nov 26 '24
Thanks man, it helped
1
u/greenappleFF Jan 06 '25
After 7 years, still the whole holy grail of env variables.
1
u/Yugo_two Jan 18 '25
A true savior
1
u/HurasmusBDraggin Feb 07 '25
This just work for me now
1
u/clinical27 Mar 20 '25
Holy legend. Got sick of this and stumbled upon a 7 year old thread, nearly ignored it until I read the recent comments lol.
1
u/BonSim Apr 08 '25
Thanks. This worked!!
1
u/Lesser_Soul Apr 11 '25
2025 and this still works! Big thanks!
1
u/Oompapoopaloopa Jul 07 '25
still works!
1
u/manbat_xd Jul 24 '25
Wow! Yep this just works lol. Before I could scroll to pages by moving my fingers 0,5cm. Now its perfect. thanks a lot
1
u/lemonscone Sep 19 '25
Eight years on and this was still the solution with Mint 22 today.
1
u/amalgovinus Oct 06 '25
This works great, what is firefox spending their time on that something so fundamental is still a problem? I didn't need the "Use smooth scrolling" option also
1
u/bxparks Oct 10 '25
My god, I've been suffering through this problem with Firefox on Linux for like 8-9 years. This finally fixed it. (Using Firefox 143.0.4 on Linux Mint 21.1). I always thought this was caused by the broken mouse drivers on Linux. But no, it was just Firefox. Why isn't this the default?
Another amazing thing: The touchscreen on my laptop actually does something useful in Firefox now. I can pinch, zoom, and scroll.
1
u/I_Threw_Up_A_Little Dec 11 '25
YAAASSSSS! My Mint experience just significantly improved! Thank you eight-years-younger mort96!!
1
u/haektpov Dec 15 '25
Thank you. This worked immediately for me on Linux Mint 22.1 and 22.2. Can’t believe I had to go through dozens of threads on Reddit and forums before I found this.
1
u/Kestrel991 Dec 19 '25
Bless you! this has been bugging me for a while.
1
u/Zubzub343 Jan 03 '26
Linux Mint 22.2, Firefox 146. This still works. Also this may be useful https://askubuntu.com/a/886914
1
u/Icy_Butterscotch6661 Jan 05 '26
Thanks, this was also helpful in addition to increase scroll distance on a Macbook repurposed as a Linux mint laptop: https://old.reddit.com/r/linuxmint/comments/14n67wn/i_wish_two_finger_scrolling_was_better_on_my/m8bubc7/
1
u/subvertcoded Feb 03 '26
Still working 2026, thank you
1
u/Only-Cancel-1023 Feb 10 '26
Bloody hell. 8 year. And this fixed all my touchpad scrolling issues on freshly installed Linux Mint.
1
u/New-Passenger-474 Feb 16 '26
This worked perfectly! Thank you!
1
u/DairyDozer Feb 20 '26
THANK YOU I spent so long messing with my firefox configs. Cant believe it was this easy LOL
1
u/pondipat Mar 07 '26
Solved. 03-2026. Thank you.
1
u/Potatoboiv2 Mar 19 '26
Actually goated. I cannot believe this is not default by now 9 years later. So annoying when there is no real connection between fingers and eyes; makes it impossible to accurately track where on the screen you are.
NOTE: By log out OP means restart your pc, not log out of firefox.
1
u/Flexico Mar 29 '26
Ooohhh, bless you. Bless you.
1
u/juani2929 May 01 '26
not working for me I'm on debian with xfce fresh install
1
u/noersetiawan May 21 '26
Thanks a lot!
1
u/GenghisKhanner Jun 19 '26
2026 and this works perfectly on Linux Mint. Thank you.
1
u/ScaramucciRecords Feb 04 '23
Thank you so much for this tip! It works.
1
u/Crazor01 Feb 11 '23
Thanks for the tip. Now all that's left to do is getting inertia scrolling to work...
1
u/Zondagsrijder May 06 '23
Oh man, thanks. Still crazy it's not the default after 5 years after your post, OP.
1
u/[deleted] May 17 '23
Thank you, Firefox finally works like Chrome on Arch Linux X11.
1
u/whyamionfireagain Aug 31 '23
Six years later, thank you! The simulated scroll wheel behavior was driving me nuts. Now it's smooth (as smooth as this trackpad will do, anyway), and it does the inertia thing too.
Worth noting, for some reason this mod made Thunderbird's calendar go nuts if it's in month view. Touch it and it skips ahead four years. In multiweek it's twitchy but usable, and if that's the price of scroll working properly everywhere else, I'll take it.
1
u/Ano_R Sep 02 '23
It still works! Is there any way to do the same for my mouse scroll wheel? Thanks.
1
u/emil_hill Oct 26 '23
Why did I only find this after a year of putting up with the annoying scrolling? Thank you very much, I can't believe it would have been so easy to fix the problem!
1
u/willDoItFromTomorrow Nov 23 '23
Thanks mate!
works well even with Firefox 120.0.
1
u/[deleted] Dec 18 '23
works like a charm, thanks a lot! i leave the 4th option on though as it smooths mouse scrolling as well (don't see much difference in touchpad scrolling with it on/off).
1
u/Philokretes1123 Jan 26 '24
You gorgeous creature! This made my entire week
1
u/eightysixed_ Jan 31 '24
Thanks for this!
I have no idea how you figured this out, but it works perfectly!
Thanks again!
1
u/Murat-Karakaya Oct 08 '26
May your blanket be warm and your pillow be cool
1
u/guiltysailor Jan 27 '26 edited Feb 06 '26
tysm op im gonna lick you
0
u/[deleted] Sep 26 '17
[deleted] — view deleted comment