Changeset 269151 in webkit
- Timestamp:
- Oct 29, 2020, 9:53:19 AM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/wpe/ScrollGestureController.cpp (modified) (4 diffs)
-
UIProcess/API/wpe/ScrollGestureController.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r269150 r269151 1 2020-10-29 Chris Lord <clord@igalia.com> 2 3 [WPE] Add axis-locking to kinetic scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=209729 5 6 Reviewed by Adrian Perez de Castro. 7 8 Add axis-locking to scroll gestures on WPE, and new WPE-specific 9 settings to control the process. 10 11 * UIProcess/API/wpe/ScrollGestureController.cpp: 12 (WebKit::ScrollGestureController::handleEvent): 13 * UIProcess/API/wpe/ScrollGestureController.h: 14 1 15 2020-10-29 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WebKit/UIProcess/API/wpe/ScrollGestureController.cpp
r259112 r269151 27 27 #include "ScrollGestureController.h" 28 28 29 #include "WebKitSettings.h" 29 30 #include <WebCore/Scrollbar.h> 30 31 31 32 namespace WebKit { 33 34 // FIXME: These ought to be either configurable or derived from system 35 // properties, such as screen size and pixel density. 36 static constexpr uint32_t scrollCaptureThreshold { 200 }; 37 static constexpr uint32_t axisLockMovementThreshold { 8 }; 38 static constexpr uint32_t axisLockActivationThreshold { 15 }; 39 static constexpr uint32_t axisLockReleaseThreshold { 30 }; 32 40 33 41 bool ScrollGestureController::handleEvent(const struct wpe_input_touch_event_raw* touchPoint) … … 40 48 m_offset.x = touchPoint->x; 41 49 m_offset.y = touchPoint->y; 50 m_xAxisLockBroken = false; 51 m_yAxisLockBroken = false; 42 52 return false; 43 53 case wpe_input_touch_event_type_motion: … … 50 60 m_handling = std::abs(deltaX) >= pixelsPerLineStep 51 61 || std::abs(deltaY) >= pixelsPerLineStep 52 || deltaTime >= 200;62 || deltaTime >= scrollCaptureThreshold; 53 63 } 54 64 if (m_handling) { … … 59 69 0, 0, 0, 60 70 }; 61 m_axisEvent.x_axis = -(m_offset.x - touchPoint->x); 62 m_axisEvent.y_axis = -(m_offset.y - touchPoint->y); 71 72 auto xOffset = std::abs(touchPoint->x - m_start.x); 73 auto yOffset = std::abs(touchPoint->y - m_start.y); 74 75 if (xOffset >= axisLockReleaseThreshold) 76 m_xAxisLockBroken = true; 77 if (yOffset >= axisLockReleaseThreshold) 78 m_yAxisLockBroken = true; 79 80 if (xOffset >= axisLockMovementThreshold && yOffset >= axisLockMovementThreshold && xOffset < axisLockActivationThreshold && yOffset < axisLockActivationThreshold) { 81 m_xAxisLockBroken = true; 82 m_yAxisLockBroken = true; 83 } 84 85 m_axisEvent.x_axis = (m_xAxisLockBroken || yOffset < axisLockActivationThreshold) ? -(m_offset.x - touchPoint->x) : 0; 86 m_axisEvent.y_axis = (m_yAxisLockBroken || xOffset < axisLockActivationThreshold) ? -(m_offset.y - touchPoint->y) : 0; 63 87 #else 64 88 m_axisEvent = { -
trunk/Source/WebKit/UIProcess/API/wpe/ScrollGestureController.h
r267916 r269151 69 69 #endif 70 70 WebWheelEvent::Phase m_phase { WebWheelEvent::Phase::PhaseNone }; 71 72 bool m_xAxisLockBroken { false }; 73 bool m_yAxisLockBroken { false }; 71 74 }; 72 75
Note:
See TracChangeset
for help on using the changeset viewer.