Bug 197690 - [GTK] Support navigation gesture on touchscreens
Summary: [GTK] Support navigation gesture on touchscreens
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Linux
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-08 03:26 PDT by Alexander Mikhaylenko
Modified: 2019-05-08 13:28 PDT (History)
7 users (show)

See Also:


Attachments
Patch (6.17 KB, patch)
2019-05-08 03:29 PDT, Alexander Mikhaylenko
mcatanzaro: review+
Details | Formatted Diff | Diff
Archive of layout-test-results from ews116 for mac-highsierra (2.93 MB, application/zip)
2019-05-08 05:18 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews213 for win-future (13.46 MB, application/zip)
2019-05-08 05:18 PDT, EWS Watchlist
no flags Details
Patch (6.22 KB, patch)
2019-05-08 09:20 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 2019-05-08 03:26:18 PDT
See the patch.
Comment 1 Alexander 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 Alexander 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 Alexander 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 Alexander 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 Alexander 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.