Bug 207113 - [GTK] Mouse wheel events on horizontal scrollbar not correctly handled when AC mode is forced
Summary: [GTK] Mouse wheel events on horizontal scrollbar not correctly handled when A...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2020-02-03 05:53 PST by Carlos Garcia Campos
Modified: 2020-07-31 03:57 PDT (History)
6 users (show)

See Also:


Attachments
Patch (26.15 KB, patch)
2020-03-05 04:15 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Patch (19.52 KB, patch)
2020-07-30 04:16 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2020-02-03 05:53:48 PST
When scrolling with the mouse over an horizontal srollbar we invert the axis to scroll horizontally. When AC mode is forced this doesn't happen because async scrolling doesn't use EventHandler::handleWheelEvent() which is where the axis are inverted. I'm not sure this is easy to fix, we should move the axis inversion to EventDispatcher.cpp, but that's happening in a secondary thread and we would need to perform a hit test to check if the mouse is over an horizontal scrollbar.
Comment 1 Carlos Garcia Campos 2020-03-05 01:35:24 PST
I've checked other browsers and they don't invert the axis when scrolling on an horizontal scrollbar, so mayb it's easier to simply stop doing so in GTK port as well. You can still use SHIFT + wheel to scroll horizontally.
Comment 2 Carlos Garcia Campos 2020-03-05 04:15:54 PST
Created attachment 392555 [details]
Patch

Horizontal scrolling with mouse wheel is still broken with async scrolling, but because it doesn't seem to be handling those events correctly (it doesn't work when using Shift + wheel either), so I'll file another bug.
Comment 3 EWS Watchlist 2020-03-05 04:16:56 PST
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-03-05 05:05:23 PST
Ok, it works with async scrolling, but only in the main frame (due to bug #208635) and the right/left direction is swapped (that's another bug)
Comment 5 Carlos Garcia Campos 2020-03-05 06:07:10 PST
(In reply to Carlos Garcia Campos from comment #4)
> Ok, it works with async scrolling, but only in the main frame (due to bug
> #208635) and the right/left direction is swapped (that's another bug)

See bug #208638
Comment 6 Carlos Garcia Campos 2020-07-30 04:16:45 PDT
Created attachment 405562 [details]
Patch
Comment 7 Adrian Perez 2020-07-30 07:35:54 PDT
Comment on attachment 405562 [details]
Patch

Really nice patch, I like it that it actually simplifies the code :)
Comment 8 Carlos Garcia Campos 2020-07-31 03:57:26 PDT
Committed r265138: <https://trac.webkit.org/changeset/265138>