black7375 / Firefox-UI-Fix

🦊 I respect proton UI and aim to improve it.
Mozilla Public License 2.0
5.35k stars 187 forks source link

Scrolling Ehancement #188

Closed black7375 closed 3 years ago

black7375 commented 3 years ago

Goal

Is your feature request related to a problem? Please describe. Currently scrolling feels less responsive and less scrolling.

Describe the solution you'd like I wish it was a little more neat and sharp.


Scrolling Test

Steps:

Kinds:

Scrolling Test

This is 30 fps, may cause janking.

Original Firefox Setting

https://user-images.githubusercontent.com/25581533/130357656-a9ec9045-cd41-4554-a287-6920e30dd188.mp4

https://user-images.githubusercontent.com/25581533/130357641-1aee5003-b52f-4442-b4f9-37125a09afd2.mp4

Little Modification

https://user-images.githubusercontent.com/25581533/130357642-9b7a1aa6-c3e9-48b7-afd0-42976f23840f.mp4

https://user-images.githubusercontent.com/25581533/130357644-b3e0a0b8-a826-4dd0-801f-0abed42faae2.mp4

Smooth Scrolling

https://user-images.githubusercontent.com/25581533/130357649-8c8eac1c-da6c-4f36-b5c9-97b6f844519b.mp4

https://user-images.githubusercontent.com/25581533/130357651-bf5d88fa-5c2b-49c2-b586-757b8ed2253b.mp4


Scrolling is a feature with a lot of likes and dislikes, so I avoided over-modification. I welcome your comments.

AveYo commented 3 years ago

glad you've liked my Natural Smooth Scrolling preset!
though mozilla kinda broke it in v88ish so I've created another one, this time around msdPhysics
haven't shared it until now, so I have limited feedback "works-for-me", yet I'm confident you're gonna like v2 even more:
Natural Smooth Scrolling for user.js

black7375 commented 3 years ago

Your setup is the best Firefox smooth scrolling I've found so far. I can feel that you've carefully tested many parameters.

black7375 commented 3 years ago

I've only edited 3 values, but I like them pretty. (tested with precision touchpad on linux)

//         Pref                                              Value                 Original
user_pref("apz.allow_zooming",                               true);            ///     true
user_pref("apz.force_disable_desktop_zooming_scrollbars",   false);            ///    false
user_pref("apz.paint_skipping.enabled",                      true);            ///     true
user_pref("apz.windows.use_direct_manipulation",             true);            ///     true
user_pref("dom.event.wheel-deltaMode-lines.always-disabled", true);            ///    false
user_pref("general.smoothScroll.currentVelocityWeighting", "0.15");            ///   "0.25"  || Change: 0.01 => 0.15
user_pref("general.smoothScroll.durationToIntervalRatio",    1000);            ///      200
user_pref("general.smoothScroll.lines.durationMaxMS",         100);            ///      150
user_pref("general.smoothScroll.lines.durationMinMS",           0);            ///      150
user_pref("general.smoothScroll.mouseWheel.durationMaxMS",    100);            ///      200
user_pref("general.smoothScroll.mouseWheel.durationMinMS",      0);            ///       50
user_pref("general.smoothScroll.mouseWheel.migrationPercent", 100);            ///      100
user_pref("general.smoothScroll.msdPhysics.continuousMotionMaxDeltaMS", 12);   ///      120
user_pref("general.smoothScroll.msdPhysics.enabled",                  true);   ///    false
user_pref("general.smoothScroll.msdPhysics.motionBeginSpringConstant", 200);   ///     1250
user_pref("general.smoothScroll.msdPhysics.regularSpringConstant",     200);   ///     1000
user_pref("general.smoothScroll.msdPhysics.slowdownMinDeltaMS",         10);   ///       12
user_pref("general.smoothScroll.msdPhysics.slowdownMinDeltaRatio",  "1.20");   ///    "1.3"
user_pref("general.smoothScroll.msdPhysics.slowdownSpringConstant",   1000);   ///     2000
user_pref("general.smoothScroll.other.durationMaxMS",         100);            ///      150
user_pref("general.smoothScroll.other.durationMinMS",           0);            ///      150
user_pref("general.smoothScroll.pages.durationMaxMS",         100);            ///      150
user_pref("general.smoothScroll.pages.durationMinMS",           0);            ///      150
user_pref("general.smoothScroll.pixels.durationMaxMS",        100);            ///      150
user_pref("general.smoothScroll.pixels.durationMinMS",          0);            ///      150
user_pref("general.smoothScroll.scrollbars.durationMaxMS",    100);            ///      150
user_pref("general.smoothScroll.scrollbars.durationMinMS",      0);            ///      150
user_pref("general.smoothScroll.stopDecelerationWeighting", "0.6");            ///    "0.4"  || Change: 0.001 => 0.6
user_pref("layers.async-pan-zoom.enabled",                   true);            ///     true
user_pref("layout.css.scroll-behavior.spring-constant",   "250.0");            ///   "250.0" || Change: 200.0 => 250.0
user_pref("mousewheel.acceleration.factor",                     3);            ///       10
user_pref("mousewheel.acceleration.start",                     -1);            ///       -1
user_pref("mousewheel.default.delta_multiplier_x",            100);            ///      100
user_pref("mousewheel.default.delta_multiplier_y",            100);            ///      100
user_pref("mousewheel.default.delta_multiplier_z",            100);            ///      100
user_pref("mousewheel.min_line_scroll_amount",                  0);            ///        5
user_pref("mousewheel.system_scroll_override_on_root_content.enabled", false); ///     true
user_pref("mousewheel.transaction.timeout",                  1500);            ///     1500
user_pref("toolkit.scrollbox.horizontalScrollDistance",         3);            ///        5
user_pref("toolkit.scrollbox.verticalScrollDistance",           3);            ///        3

Guess I'll have to go home and test 3 more devices and windows.


@AveYo

  1. May I use your code in my project? (License issue)
  2. I recently found out about these settings. Do you have any opinion on this?
    • mousewheel.system_scroll_override.enabled
    • mousewheel.system_scroll_override.vertical.factor
    • mousewheel.system_scroll_override.horizontal.factor
AveYo commented 3 years ago

sure thing!

I actually use layout.css.scroll-behavior.spring-constant 300 and some different timings. I've kept the *Weighting values as in v1, it was a must there to prevent micro-stutters,
but with msdPhysics maybe it's fine to go back to defaults-ish. Will check how it feels with your input

mousewheel.system_scroll_override.enabled is yet another "we-know-best-screw-the-rest" from mozilla devs, like general.smoothScroll.mouseWheel.migrationPercent before it, and the already turned off in the preset: mousewheel.system_scroll_override_on_root_content.enabled which is the equivalent annoyance for windows.
Will add this latest linux annoyance as off in the preset as well.

black7375 commented 3 years ago

Thanks for the code and advice!! It's been a huge help.

AveYo commented 3 years ago

as suspected there's not a huge difference for my setup (2$ mouse, decades old synaptics touchpad), but I will take your word for it that the *Weighting makes it better on a precision touchpad so I will update the published preset ;)

black7375 commented 3 years ago

I'm also testing it at home and on an older device, and it's definitely different.

AveYo commented 3 years ago

I meant the core smoothness is done by all the other variables Will test some more when uupdump conversion script is done on the potato and I plug my trusted high refresh rate crt ;)

AveYo commented 3 years ago

mousewheel.system_scroll_override.enabled false is problematic across platforms,
on windows makes the scrolling rather slow (for those that got used to the default behavior)
on linux is a mixed bag, either faster than windows, same as windows, or slower
ty mozilla for the added consistency

decided to keep it true in the preset, and added a commented line at the end to set it false if scrolling feels too fast (and that can happen both on linux and windows with some device drivers)

black7375 commented 3 years ago

Yes. I think that would be good.

AveYo commented 3 years ago

I had a fair use in mind when I've shared it, like it would be nice to leave a small mention in the script "based on natural smooth scrolling v2 by aveyo" since nobody reads issues and changelogs, but if that does not work for you, np

black7375 commented 3 years ago

There was a mistake in the commit history for a while, so I committed again.

Now it shows up in three.

black7375 commented 3 years ago

I'll close it because I think it's open enough.

black7375 commented 3 years ago

I'll close it because I think it's open enough.

adroslice commented 3 years ago

I strongly dislike this scrolling behaviour, and it was very confusing when it first turned up. It should probably be optional in script installation.

black7375 commented 3 years ago

What scrolling characteristics did you not like?

adroslice commented 3 years ago

Mainly that the scrolling animation takes far longer to actually complete, which makes productive usage of the browser, for me, much harder.

AveYo commented 2 years ago

PSA: Natural Smooth Scrolling V3 is up It's even more smoother while slowly scrolling few notches at a time, but it then skips scrolling animations when doing more at a time / faster

@black7375, obviously everybody's got their own preferences, so it can't be imposed upon them ;)

Tho my biased opinion is that v3 preset offers the best smooth scrolling so far, technically And it's versatile, I left at the end of the script two alternatives commented out, one more closer to v2 and one even smoother than v3. Just fiddle with the motionBeginSpringConstant and regularSpringConstant values to lean towards smoother or sharper.

black7375 commented 2 years ago

I'll check. Thank you for your effort.