[webkit-changes] [WebKit/WebKit] 14aef5: [WPE] Do not generate click event for long touch p...

Bastian Krause noreply at github.com
Mon Apr 17 12:18:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 14aef58eda45d6e9a240ddff910a5234a1828d3d
      https://github.com/WebKit/WebKit/commit/14aef58eda45d6e9a240ddff910a5234a1828d3d
  Author: Bastian Krause <bst at pengutronix.de>
  Date:   2023-04-17 (Mon, 17 Apr 2023)

  Changed paths:
    M Source/WebKit/UIProcess/API/libwpe/TouchGestureController.cpp
    M Source/WebKit/UIProcess/API/libwpe/TouchGestureController.h
    M Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
    M Source/WebKit/UIProcess/API/wpe/WPEView.cpp

  Log Message:
  -----------
  [WPE] Do not generate click event for long touch presses
https://bugs.webkit.org/show_bug.cgi?id=248076

Reviewed by Michael Catanzaro.

Similar to the GTK port, a contextmenuevent should be generated for long
presses instead of a click event. We could generate a sequence of mouse
motion towards the desired point, mouse down, mouse up
(wpe_input_pointer_modifier_button2). This would cause the
contextmenuevent to be emitted, but also mousedown/mouseup events, which
are not expected. Since there seems to be no other way of doing this (at
the moment), implement a compromise: implement the detection of long tap
gestures, but don't generate the context mouse events yet.

Use a threshold value of 500 ms for detecting long tap gestures similar
to gtk-long-press-time's default of 500 ms.

See also: https://bugs.webkit.org/show_bug.cgi?id=251925

* Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent): Add no-op on
TouchGestureController::ContextMenuEvent.
* Source/WebKit/UIProcess/API/libwpe/TouchGestureController.cpp:
(WebKit::TouchGestureController::handleEvent): Generate ContextMenuEvent
for long presses.
* Source/WebKit/UIProcess/API/libwpe/TouchGestureController.h: Add
ContextMenu to GesturedEvent enum, create ContextMenuEvent and add it to
EventVariant.
* Source/WebKit/UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend): Add no-op for
TouchGestureController::ContextMenuEvent.

Canonical link: https://commits.webkit.org/263030@main




More information about the webkit-changes mailing list