[PATCH wayland] protocol: Add pointer gestures (swipe/pinch) protocol
Pekka Paalanen
ppaalanen at gmail.com
Thu Jul 16 01:47:59 PDT 2015
On Wed, 15 Jul 2015 20:02:10 +0200
Carlos Garnacho <carlosg at gnome.org> wrote:
> The lifetime and progress of gestures is maintained by the separate
> wl_pointer_gesture_pinch and wl_pointer_gesture_swipe interfaces,
> each of these has begin/update(optional)/end phases, as transmitted
> by their events.
>
> The gesture interfaces can be obtained from the wl_pointer, and
> must be interpreted on the last surface entered by the pointer,
> starting from the pointer coordinates.
>
> Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
> ---
> protocol/wayland.xml | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 151 insertions(+), 2 deletions(-)
Hi,
just two drive-by comments:
>
> diff --git a/protocol/wayland.xml b/protocol/wayland.xml
> index 42c9309..51effad 100644
> --- a/protocol/wayland.xml
> +++ b/protocol/wayland.xml
> @@ -1329,7 +1329,7 @@
> </request>
> </interface>
>
> - <interface name="wl_seat" version="4">
> + <interface name="wl_seat" version="5">
> <description summary="group of input devices">
> A seat is a group of keyboards, pointer and touch devices. This
> object is published as a global during start up, or when such a
> @@ -1402,7 +1402,139 @@
>
> </interface>
>
> - <interface name="wl_pointer" version="3">
> + <interface name="wl_pointer_gesture_swipe" version="5">
> + <description summary="a swipe gesture object">
> + A swipe gesture object notifies a client about a multi-finger swipe
> + gesture detected on an indirect input device such as a touchpad.
> + The gesture is usually initiated by multiple fingers moving in the
> + same direction but once initiated the direction may change.
> + The precise conditions of when such a gesture is detected are
> + implementation-dependent.
> +
> + A gesture consists of three stages: begin, update (optional) and end.
> +
> + A gesture may be cancelled by the compositor or the hardware.
> + Destructive actions should not be considered until the end of a
> + gesture has been received.
> + </description>
> +
> + <request name="release" since="5">
Name this "destroy". Then it will match wl_blah_destroy() so we get
both destruction request and wl_proxy freeing with the same call and
there won't be a misleading wl_blah_destroy() function defined that
won't send the request. Also mark it as a destructor.
The old wl_pointer etc. interfaces only have a "release" request,
because they did not define destructor protocol at all when first
introduced (a mistake), and adding it later is not possible. So the
"release" request is a workaround for a server-side object leak (that
gets cleaned up only when the whole client disconnects).
wayland-scanner will always generate a wl_blah_destroy() function that
will free the proxy. Making it also send a request is up to the protocol
spec.
See e.g. wl_region for an example of a destructor.
> + <description summary="release the pointer swipe gesture object"/>
> + </request>
> + <interface name="wl_pointer_gesture_pinch" version="5">
> + <description summary="a pinch gesture object">
> + A swipe gesture object notifies a client about a multi-finger pinch
> + gesture detected on an indirect input device such as a touchpad.
> + The gesture is usually initiated by multiple fingers moving towards
> + each other or away from each other, or by two or more fingers rotating
> + around a logical center of gravity. The precise conditions of when
> + such a gesture is detected are implementation-dependent.
> +
> + A gesture consists of three stages: begin, update (optional) and end.
> +
> + A gesture may be cancelled by the compositor or the hardware.
> + Destructive actions should not be considered until the end of a
> + gesture has been received.
> + </description>
> +
> + <request name="release" since="5">
Here too.
Thanks,
pq
More information about the wayland-devel
mailing list