Changeset 247862 in webkit


Ignore:
Timestamp:
Jul 26, 2019 2:00:32 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
https://bugs.webkit.org/show_bug.cgi?id=200084

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-07-26
Reviewed by Carlos Garcia Campos.

gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
that.

See https://gitlab.gnome.org/GNOME/gtk/issues/2048

Source/WebCore:

  • platform/gtk/PlatformWheelEventGtk.cpp:

(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

  • Shared/gtk/WebEventFactory.cpp:

(WebKit::WebEventFactory::createWebWheelEvent):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247860 r247862  
     12019-07-26  Alexander Mikhaylenko  <exalm7659@gmail.com>
     2
     3        REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
     4        https://bugs.webkit.org/show_bug.cgi?id=200084
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
     9        the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
     10        they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
     11        that.
     12
     13        See https://gitlab.gnome.org/GNOME/gtk/issues/2048
     14
     15        * platform/gtk/PlatformWheelEventGtk.cpp:
     16        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
     17
    1182019-07-26  Rob Buis  <rbuis@igalia.com>
    219
  • trunk/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp

    r247670 r247862  
    6464    GdkScrollDirection direction;
    6565    if (!gdk_event_get_scroll_direction(reinterpret_cast<GdkEvent*>(event), &direction)) {
     66        direction = GDK_SCROLL_SMOOTH;
    6667        gdouble deltaX, deltaY;
    6768        if (gdk_event_get_scroll_deltas(reinterpret_cast<GdkEvent*>(event), &deltaX, &deltaY)) {
     
    8586        case GDK_SCROLL_RIGHT:
    8687            m_deltaX = -delta;
     88            break;
     89        case GDK_SCROLL_SMOOTH:
    8790            break;
    8891        default:
  • trunk/Source/WebKit/ChangeLog

    r247861 r247862  
     12019-07-26  Alexander Mikhaylenko  <exalm7659@gmail.com>
     2
     3        REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
     4        https://bugs.webkit.org/show_bug.cgi?id=200084
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
     9        the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
     10        they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
     11        that.
     12
     13        See https://gitlab.gnome.org/GNOME/gtk/issues/2048
     14
     15        * Shared/gtk/WebEventFactory.cpp:
     16        (WebKit::WebEventFactory::createWebWheelEvent):
     17
    1182019-07-26  Loïc Yhuel  <loic.yhuel@softathome.com>
    219
  • trunk/Source/WebKit/Shared/gtk/WebEventFactory.cpp

    r246677 r247862  
    206206    GdkScrollDirection direction;
    207207    if (!gdk_event_get_scroll_direction(event, &direction)) {
     208        direction = GDK_SCROLL_SMOOTH;
    208209        double deltaX, deltaY;
    209210        if (gdk_event_get_scroll_deltas(event, &deltaX, &deltaY))
     
    224225        case GDK_SCROLL_RIGHT:
    225226            wheelTicks = FloatSize(-1, 0);
     227            break;
     228        case GDK_SCROLL_SMOOTH:
    226229            break;
    227230        default:
Note: See TracChangeset for help on using the changeset viewer.