Bug 213791 - [GTK4] Support kinetic scrolling
Summary: [GTK4] Support kinetic scrolling
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2020-06-30 06:37 PDT by Alexander Mikhaylenko
Modified: 2020-07-03 01:38 PDT (History)
5 users (show)

See Also:

Patch (5.38 KB, patch)
2020-06-30 06:42 PDT, Alexander Mikhaylenko
no flags Details | Formatted Diff | Diff
Patch (5.89 KB, patch)
2020-07-02 07:33 PDT, Alexander Mikhaylenko
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Mikhaylenko 2020-06-30 06:37:44 PDT
See the patch.
Comment 1 Alexander Mikhaylenko 2020-06-30 06:42:06 PDT
Created attachment 403194 [details]
Comment 2 Alexander Mikhaylenko 2020-06-30 06:42:55 PDT
There's a bug where the velocity is calculated incorrectly. That's https://bugs.webkit.org/show_bug.cgi?id=213789, it happens in GTK3 as well, so a separate bug.
Comment 3 EWS Watchlist 2020-06-30 06:43:03 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 Carlos Garcia Campos 2020-07-02 02:15:02 PDT
Comment on attachment 403194 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=403194&action=review

Thanks! I think it would be easier to refactor the WebEventFactory create functions.

> Source/WebKit/Shared/NativeWebWheelEvent.h:64
>      NativeWebWheelEvent(GdkEvent*, const WebCore::IntPoint&, const WebCore::FloatSize& wheelTicks);
> +    NativeWebWheelEvent(GdkEvent*, const WebCore::IntPoint&, const WebCore::FloatSize& wheelTicks, WebWheelEvent::Phase, WebWheelEvent::Phase momentumPhase);

I think this new one makes the previous one unused, so better to modify the existing one if needed.

> Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:1278
> +    WebWheelEvent::Phase phase = gdk_event_is_scroll_stop_event(event) ?
> +        WebWheelEvent::Phase::PhaseEnded :
> +        WebWheelEvent::Phase::PhaseChanged;

So, in the end we are passing a fixed momentum phase and phase value that depends on event, so this could be done in WebEventFactory.cpp instead if the parameters currently passed.
Comment 5 Alexander Mikhaylenko 2020-07-02 05:07:30 PDT
Sure, makes sense.
Comment 6 Alexander Mikhaylenko 2020-07-02 07:33:16 PDT
Created attachment 403366 [details]
Comment 7 EWS 2020-07-03 01:38:01 PDT
Committed r263887: <https://trac.webkit.org/changeset/263887>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 403366 [details].