PSA: By default, Firefox on Linux doesn’t match with your monitor’s native/current refresh rate if you’re using a high refresh rate monitor. Here’s how I fixed it.

reddit

Just discovered this today while trying to fix Firefox's mouse scrolling as I can feel it's quite janky compared to when using Chrome/Chromium (still on Linux) or when I'm on Windows (dual boot) on any browser.

It felt like I was running 30 ~ 60 FPS at the minimum so I can definitely feel the difference since the rest of the system runs at 144hz (i.e, dragging windows around, mouse pointer, games, etc.).

My current setup: F33, Gnome wayland, 2k 144hz monitor.

To correct this. First, make sure that you're running the supported refresh rate of your monitor (I already did so this wasn't my problem). But on Gnome, it's just in the Settings > Displays > Refresh Rate. I think you need xrandr for other WM though.

Next, open Firefox's about:config and set this key (default = -1):

layout.frame_rate 144 

That's it! Restart Firefox and scroll through any webpage in your monitor's native speed!

Bonus: Here's the mouse scrolling tweaks that I used to match with my preference (first problem as mentioned). YMMV so feel free to tweak this in case you prefer a different feel.

general.smoothScroll.msdPhysics.enabled true mousewheel.min_line_scroll_amount 30 

There are other related settings that you could tweak like:

general.smoothScroll.currentVelocityWeighting general.smoothScroll.mouseWheel.durationMaxMS general.smoothScroll.mouseWheel.durationMinMS general.smoothScroll.stopDecelerationWeighting 

The first two was sufficient enough for me so I left the other settings as is.

Edit:

So I tried to replicate the same issue on Xorg as a guy below said nothing changed from his side, I found that this seems to be more about the display servers or compositors (Wayland, Xorg) than Firefox all alone.

I tried logging in through an Xorg session and set the layout.frame_rate back to -1 and there I had no issues with scrolling not running on the right frame rate, it was all good, tested after a few restarts and it was running correctly. I then got back to wayland and it was all the same issue again, set back to the frame_rate to 144 and it was all good.

I'm not familiar yet with how display servers or compositors work under the hood so I'll let someone else chime in on this if this was actually the culprit here.

submitted by /u/nozth
[link] [comments]