Skip to content

Commit

Permalink
Cherry-pick 278161@main (a094954). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=273468

    [WPE] WPE Platform: Fix touch events propagation
    https://bugs.webkit.org/show_bug.cgi?id=273468

    Reviewed by Carlos Garcia Campos.

    This change makes it possible to store events with sequence id == 0
    in the HashMap thus allowing them to be propagated.
    This change also takes touch points of UP/CANCEL events into account
    so that those events are propagated correctly as well.

    * Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp:
    (WKWPE::m_backend):
    * Source/WebKit/UIProcess/API/wpe/WPEWebView.h:

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

Canonical link: https://commits.webkit.org/274313.201@webkitglib/2.44
  • Loading branch information
Scony authored and aperezdc committed May 2, 2024
1 parent 8cf816e commit 808c221
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ View::View(struct wpe_view_backend* backend, WPEDisplay* display, const API::Pag
case WPE_EVENT_TOUCH_CANCEL: {
// FIXME: gestures
#if ENABLE(TOUCH_EVENTS)
webView.m_touchEvents.set(wpe_event_touch_get_sequence_id(event), event);
auto points = webView.touchPointsForEvent(event);
webView.m_touchEvents.remove(wpe_event_touch_get_sequence_id(event));
webView.page().handleTouchEvent(NativeWebTouchEvent(event, WTFMove(points)));
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/API/wpe/WPEWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class View : public API::ObjectImpl<API::Object::Type::View> {
#if ENABLE(TOUCH_EVENTS)
std::unique_ptr<WebKit::TouchGestureController> m_touchGestureController;
#if ENABLE(WPE_PLATFORM)
HashMap<uint32_t, GRefPtr<WPEEvent>> m_touchEvents;
HashMap<uint32_t, GRefPtr<WPEEvent>, IntHash<uint32_t>, WTF::UnsignedWithZeroKeyHashTraits<uint32_t>> m_touchEvents;
#endif
#endif
std::unique_ptr<WebKit::PageClientImpl> m_pageClient;
Expand Down

0 comments on commit 808c221

Please sign in to comment.