[Webkit-unassigned] [Bug 155750] [GTK] Add kinetic scrolling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 14 07:54:08 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=155750

--- Comment #17 from Adrien Plazas <aplazas at igalia.com> ---
About the several comments on floating point value: you're right it's cleaner to check that way, thanks!

> > Source/WebKit2/UIProcess/gtk/GestureController.cpp:80
> > +void GestureController::DragGesture::startDrag(const GdkEvent* event)
> 
> It seems this file has now three functions that create a scroll event out of
> a touch event: this one, startMomentumScroll() a bit further in this patch,
> and handleDrag() already in code. Maybe a common helper function could be
> done for these 3?

I just added this:
static GUniquePtr<GdkEvent> newScrollEvent(const GdkEvent* event, double x, double y, double deltaX, double deltaY, gboolean isStop)
{
    GUniquePtr<GdkEvent> scrollEvent(gdk_event_new(GDK_SCROLL));
    scrollEvent->scroll.time = event->touch.time;
    scrollEvent->scroll.x = x;
    scrollEvent->scroll.y = y;
    scrollEvent->scroll.x_root = event->touch.x_root;
    scrollEvent->scroll.y_root = event->touch.y_root;
    scrollEvent->scroll.direction = GDK_SCROLL_SMOOTH;
    scrollEvent->scroll.delta_x = deltaX;
    scrollEvent->scroll.delta_y = deltaY;
    scrollEvent->scroll.state = event->touch.state;
#if GTK_CHECK_VERSION(3, 20, 0)
    scrollEvent->scroll.is_stop = isStop;
#endif
    return scrollEvent;
}

I'll soon (tomorrow?) publish a hopefully final version then, thanks for the review!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160614/e42ccb21/attachment.html>


More information about the webkit-unassigned mailing list