[webkit-reviews] review granted: [Bug 140747] [GTK] Support using long-tap gesture to open context menu : [Attachment 332256] Patch adding long press gesture
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jan 26 01:54:27 PST 2018
Carlos Garcia Campos <cgarcia at igalia.com> has granted Jan-Michael Brummer
<jan.brummer at tabos.org>'s request for review:
Bug 140747: [GTK] Support using long-tap gesture to open context menu
https://bugs.webkit.org/show_bug.cgi?id=140747
Attachment 332256: Patch adding long press gesture
https://bugs.webkit.org/attachment.cgi?id=332256&action=review
--- Comment #4 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 332256
--> https://bugs.webkit.org/attachment.cgi?id=332256
Patch adding long press gesture
View in context: https://bugs.webkit.org/attachment.cgi?id=332256&action=review
> Source/WebKit/UIProcess/gtk/GestureController.cpp:302
> + GUniquePtr<GdkEvent> pointerEvent(gdk_event_new(GDK_MOTION_NOTIFY));
> + pointerEvent->motion.time = event->touch.time;
> + pointerEvent->motion.x = event->touch.x;
> + pointerEvent->motion.y = event->touch.y;
> + pointerEvent->motion.x_root = event->touch.x_root;
> + pointerEvent->motion.y_root = event->touch.y_root;
> + pointerEvent->motion.state = event->touch.state;
> + m_page.handleMouseEvent(NativeWebMouseEvent(pointerEvent.get(), 0));
> +
> + pointerEvent.reset(gdk_event_new(GDK_BUTTON_PRESS));
> + pointerEvent->button.button = GDK_BUTTON_SECONDARY;
> + pointerEvent->button.time = event->touch.time;
> + pointerEvent->button.x = event->touch.x;
> + pointerEvent->button.y = event->touch.y;
> + pointerEvent->button.x_root = event->touch.x_root;
> + pointerEvent->button.y_root = event->touch.y_root;
> + m_page.handleMouseEvent(NativeWebMouseEvent(pointerEvent.get(), 1));
> +
> + pointerEvent->type = GDK_BUTTON_RELEASE;
> + m_page.handleMouseEvent(NativeWebMouseEvent(pointerEvent.get(), 0));
This code is duplicated in tap gesture. We could move it to a helper function
that simply receives the button (primary or secondary).
More information about the webkit-reviews
mailing list