Title: [278198] trunk/Source/WebKit
- Revision
- 278198
- Author
- commit-qu...@webkit.org
- Date
- 2021-05-28 08:56:18 -0700 (Fri, 28 May 2021)
Log Message
[WPE] Correctly compute wheel event phase for 2D axis events
https://bugs.webkit.org/show_bug.cgi?id=226370
Patch by Zan Dobersek <zdober...@igalia.com> on 2021-05-28
Reviewed by Adrian Perez de Castro.
2D-capable wpe_input_axis_event objects don't have usable axis and delta
values set on the base struct, but keep all that information on the more
detailed wpe_input_axis_2d_event struct.
For such events, the correct phase then has to be special-cased,
otherwise the default determination marks both axes as inactive and only
PhaseEnded events are dispatched into the engine.
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (278197 => 278198)
--- trunk/Source/WebKit/ChangeLog 2021-05-28 15:50:45 UTC (rev 278197)
+++ trunk/Source/WebKit/ChangeLog 2021-05-28 15:56:18 UTC (rev 278198)
@@ -1,3 +1,21 @@
+2021-05-28 Zan Dobersek <zdober...@igalia.com>
+
+ [WPE] Correctly compute wheel event phase for 2D axis events
+ https://bugs.webkit.org/show_bug.cgi?id=226370
+
+ Reviewed by Adrian Perez de Castro.
+
+ 2D-capable wpe_input_axis_event objects don't have usable axis and delta
+ values set on the base struct, but keep all that information on the more
+ detailed wpe_input_axis_2d_event struct.
+
+ For such events, the correct phase then has to be special-cased,
+ otherwise the default determination marks both axes as inactive and only
+ PhaseEnded events are dispatched into the engine.
+
+ * UIProcess/API/wpe/WPEView.cpp:
+ (WKWPE::m_backend):
+
2021-05-28 Eric Carlson <eric.carl...@apple.com>
[GPUP] [Video/Audio/Text]TrackPrivateRemote.h should use startTimeVariance
Modified: trunk/Source/WebKit/UIProcess/API/wpe/WPEView.cpp (278197 => 278198)
--- trunk/Source/WebKit/UIProcess/API/wpe/WPEView.cpp 2021-05-28 15:50:45 UTC (rev 278197)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WPEView.cpp 2021-05-28 15:56:18 UTC (rev 278198)
@@ -167,6 +167,27 @@
Horizontal
};
+ // We treat an axis motion event with a value of zero to be equivalent
+ // to a 'stop' event. Motion events with zero motion don't exist naturally,
+ // so this allows a backend to express 'stop' events without changing API.
+ // The wheel event phase is adjusted accordingly.
+ WebWheelEvent::Phase phase = WebWheelEvent::Phase::PhaseChanged;
+ WebWheelEvent::Phase momentumPhase = WebWheelEvent::Phase::PhaseNone;
+
+#if WPE_CHECK_VERSION(1, 5, 0)
+ if (event->type & wpe_input_axis_event_type_mask_2d) {
+ auto* event2D = reinterpret_cast<struct wpe_input_axis_2d_event*>(event);
+ view.m_horizontalScrollActive = !!event2D->x_axis;
+ view.m_verticalScrollActive = !!event2D->y_axis;
+ if (!view.m_horizontalScrollActive && !view.m_verticalScrollActive)
+ phase = WebWheelEvent::Phase::PhaseEnded;
+
+ auto& page = view.page();
+ page.handleWheelEvent(WebKit::NativeWebWheelEvent(event, page.deviceScaleFactor(), phase, momentumPhase));
+ return;
+ }
+#endif
+
switch (event->axis) {
case Vertical:
view.m_horizontalScrollActive = !!event->value;
@@ -176,14 +197,16 @@
break;
}
- // We treat an axis motion event with a value of zero to be equivalent
- // to a 'stop' event. Motion events with zero motion don't exist naturally,
- // so this allows a backend to express 'stop' events without changing API.
- auto& page = view.page();
- if (event->value)
- page.handleWheelEvent(WebKit::NativeWebWheelEvent(event, page.deviceScaleFactor(), WebWheelEvent::Phase::PhaseChanged, WebWheelEvent::Phase::PhaseNone));
- else if (!view.m_horizontalScrollActive && !view.m_verticalScrollActive)
- page.handleWheelEvent(WebKit::NativeWebWheelEvent(event, page.deviceScaleFactor(), WebWheelEvent::Phase::PhaseEnded, WebWheelEvent::Phase::PhaseNone));
+ bool shouldDispatch = !!event->value;
+ if (!view.m_horizontalScrollActive && !view.m_verticalScrollActive) {
+ shouldDispatch = true;
+ phase = WebWheelEvent::Phase::PhaseEnded;
+ }
+
+ if (shouldDispatch) {
+ auto& page = view.page();
+ page.handleWheelEvent(WebKit::NativeWebWheelEvent(event, page.deviceScaleFactor(), phase, momentumPhase));
+ }
},
// handle_touch_event
[](void* data, struct wpe_input_touch_event* event)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes