liferea icon indicating copy to clipboard operation
liferea copied to clipboard

how to change the scroll speed in internal browser

Open seflerZ opened this issue 4 years ago • 4 comments

I know the internal browser was implemented by WebKit, but I can't find any way to change the scrolling speed. The only way I suppose is using the WebKitConfig plugin, but I don' t find the entrance neither.

seflerZ avatar Nov 09 '21 10:11 seflerZ

I also do not know how this could be achieved.

lwindolf avatar Nov 12 '21 23:11 lwindolf

This can be a problem of WebKit as described here.

seflerZ avatar Apr 02 '22 08:04 seflerZ

I've downloaded and compiled the lastest webkitgtk-2.36 but still result in low scrolling. I'll continue to dig in this problem.

seflerZ avatar Apr 20 '22 04:04 seflerZ

I've looked into the WebKitGTK source code and found workaround. The scroll event was handled by "ScrollingEffectsController::handleWheelEvent(const PlatformWheelEvent& wheelEvent)" function in "./Source/WebCore/platform/ScrollingEffectsController.cpp". You can modify the deltaX and deltaY to change the wheel speed. The simple way would be multiply a const like 2 or 4 to them.

bool ScrollingEffectsController::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
#if ENABLE(KINETIC_SCROLLING)
    m_inScrollGesture = wheelEvent.hasPreciseScrollingDeltas() && !wheelEvent.isEndOfNonMomentumScroll() && !wheelEvent.isTransitioningToMomentumScroll();

    if (processWheelEventForKineticScrolling(wheelEvent))
        return true;
#endif

    auto scrollOffset = m_client.scrollOffset();
    float deltaX = m_client.allowsHorizontalScrolling() ? wheelEvent.deltaX() * 2: 0; // <--- changed HERE
    float deltaY = m_client.allowsVerticalScrolling() ? wheelEvent.deltaY() * 2: 0; // <--- changed HERE
    auto extents = m_client.scrollExtents();
    auto minPosition = extents.minimumScrollOffset();
...

Also you can decrease the animation time to get a faster scroll speed. It's located in "./Source/WebCore/platform/ScrollAnimationSmooth.cpp", search for method "durationFromDistance" to change.

Later I'll try to find out the cause of the small delta value.

seflerZ avatar Apr 20 '22 13:04 seflerZ