Bug 197690

Summary: [GTK] Support navigation gesture on touchscreens
Product: WebKit Reporter: Alice Mikhaylenko <alicem>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Enhancement CC: berto, bugs-noreply, cgarcia, commit-queue, ews-watchlist, gustavo, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Linux   
Attachments:
Description Flags
Patch
mcatanzaro: review+
Archive of layout-test-results from ews116 for mac-highsierra
none
Archive of layout-test-results from ews213 for win-future
none
Patch none

Description Alice Mikhaylenko 2019-05-08 03:26:18 PDT
See the patch.
Comment 1 Alice Mikhaylenko 2019-05-08 03:29:34 PDT
Created attachment 369370 [details]
Patch
Comment 2 EWS Watchlist 2019-05-08 03:30:26 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 3 Alice Mikhaylenko 2019-05-08 03:30:44 PDT
mcatanzaro: I've decided to include the threshold change here at the end, because that change was motivated by wanting to use the same semantics for touchscreen and touchpad, and it's hard to explain on its own.
Comment 4 EWS Watchlist 2019-05-08 05:18:00 PDT Comment hidden (spam)
Comment 5 EWS Watchlist 2019-05-08 05:18:02 PDT Comment hidden (spam)
Comment 6 EWS Watchlist 2019-05-08 05:18:26 PDT Comment hidden (spam)
Comment 7 EWS Watchlist 2019-05-08 05:18:29 PDT Comment hidden (spam)
Comment 8 Michael Catanzaro 2019-05-08 08:25:31 PDT
Comment on attachment 369370 [details]
Patch

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

> Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp:40
> +static const double gtkScrollDeltaMultiplier = 10;

A lot of users have been complaining that scrolling the web view doesn't move the web content as much as in other browsers. Is that something you'd be interested in trying to improve?

> Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp:190
> +    if (isTouchEvent(event))
> +        deltaX *= (double) Scrollbar::pixelsPerLineStep() / m_webPageProxy.viewSize().width();
> +    else
> +        deltaX *= gtkScrollDeltaMultiplier / swipeTouchpadBaseWidth;

Just make sure the divisors can never be zero.
Comment 9 Alice Mikhaylenko 2019-05-08 08:45:42 PDT
> Just make sure the divisors can never be zero.

I.e. the width? One of them is constant, the other one... Can there be a situation where viewport size is zero and you can perform a swipe? :o

> A lot of users have been complaining that scrolling the web view doesn't move the web content as much as in other browsers. Is that something you'd be interested in trying to improve?

I can look at it, but I need more details. The "other browsers" are presumably Firefox, since Chrome doesn't support pixel-perfect touchpad scrolling in the first place. I'd personally prefer it to match GTK behavior.

Links to a request would be appreciated, maybe it meant mouse scrolling, which is a completely different thing anyway.
Comment 10 Michael Catanzaro 2019-05-08 08:55:36 PDT
(In reply to Alexander Mikhaylenko from comment #9)
> > Just make sure the divisors can never be zero.
> 
> I.e. the width? One of them is constant, the other one... Can there be a
> situation where viewport size is zero and you can perform a swipe? :o

Probably not, I just wanted you to think about it.

> I can look at it, but I need more details. The "other browsers" are
> presumably Firefox, since Chrome doesn't support pixel-perfect touchpad
> scrolling in the first place. I'd personally prefer it to match GTK behavior.
> 
> Links to a request would be appreciated, maybe it meant mouse scrolling,
> which is a completely different thing anyway.

It's a separate issue. Don't worry about it here.
Comment 11 Alice Mikhaylenko 2019-05-08 09:05:51 PDT
Just in case checked with GTK_OVERLAY_SCROLLING=0. Viewport size still doesn't change.
Comment 12 Alice Mikhaylenko 2019-05-08 09:20:58 PDT
Created attachment 369391 [details]
Patch

Err, I missed "Moved ViewGestureController" in the description, that was a placeholder I meant to fill later. :) Done
Comment 13 WebKit Commit Bot 2019-05-08 13:28:28 PDT
Comment on attachment 369391 [details]
Patch

Clearing flags on attachment: 369391

Committed r245065: <https://trac.webkit.org/changeset/245065>
Comment 14 WebKit Commit Bot 2019-05-08 13:28:30 PDT
All reviewed patches have been landed.  Closing bug.