libinput added gesture recognition some years ago. The corresponding wayland protocol is zwp_pointer_gestures_v1 https://github.com/wayland-project/wayland-protocols/blob/master/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml Various compositors support it. So we should be able to generate a QNativeGestureEvent when an application receives a gesture from the compositor, such that Qt applications running on those compositors will act a lot like when using the trackpad on macOS: PinchHandler reacts to the touchpad pinch gesture, mainly.
The swipe gesture also exists on macOS, but we don't react to it in any Qt Quick handlers (or items) yet. When we figure out what should be the difference between pan and swipe, and what each of them should be used for, we should do something with both, ideally. But this wayland protocol only defines pinch and swipe. The swipe update events contain dx and dy in pixels, whereas QSwipeGesture has enum directions and an angle, and QNativeGestureEvent has value(): a single qreal, which is used for a quantized angle on macOS currently (90, 180, 270, 0... apparently dx and dy can only be ±1 there); but the storage is already big enough to store a QPointF if we need to (we have no current use for the qint64 in that class, actually).
Next, we could use libinput gestures in the eglfs plugin, and be able to send that protocol in Qt wayland compositors; but those can be other tasks beyond this one.
|For Gerrit Dashboard: QTBUG-92098|
|330543,7||Add protocol for pointer-gestures-unstable-v1||dev||qt/qtwayland||Status: MERGED||+2||0|
|341008,10||Add storage for (pixel) deltas and fingerCount to QNativeGestureEvent||dev||qt/qtbase||Status: MERGED||+2||0|