[PATCH weston v3 1/5] protocol: Add _wl_pointer_gestures (swipe/pinch) protocol

Bryce Harrington bryce at osg.samsung.com
Thu Aug 27 12:09:06 PDT 2015


On Thu, Aug 27, 2015 at 12:52:39PM -0500, Derek Foreman wrote:
> On 27/08/15 02:27 AM, Pekka Paalanen wrote:
> > On Wed, 26 Aug 2015 17:57:47 -0700
> > Bryce Harrington <bryce at osg.samsung.com> wrote:
> > 
> >> This patchset is looking reasonably ripe.  If pq and/or derek give
> >> thumbs up, and you get a v4 turned around quickly (i.e. before the end
> >> of the month) with the changes mentioned in this thread, I wouldn't mind
> >> landing this for 1.9-beta.  This seems relatively safe to me, as it
> >> isn't invasive into core code, and just adds an experimental protocol +
> >> implementation + example client support.
> 
> Definitely appears to need a v4 - looks like it won't build right now
> due to the old style direct use of seat->pointer, and there are other
> critical comments...
> 
> My concerns are:
> I think I agree with Bill that it would make sense that rotations be
> relative to starting point.
> 
> Is it really OK that this isn't part of the grab interface?  They do
> seem grabby to me...
> 
> 
> But this isn't really my area of expertise so I'll defer to the other
> reviewers.
> 
> > Hi,
> > 
> > hmm, I would say that adding a whole new extension is a major feature,
> > so not beta material. That would go also for bumping version on
> > existing extensions.
> > 
> > Have we landed this kind of stuff before at this stage of the release
> > cycle?
> > 
> > May have done that with xdg-shell, bumping the version, but that was a
> > nasty case.
> 
> Hmm, this does add a bunch of new stuff, but it seems fairly well
> compartmentalized.  Being new protocol instead of a change to old
> protocol makes it less likely to ruin someone's day.
> 
> It's experimental protocol so it's not going to surprise anyone if it
> changes later (ie: landed too early), and it appears to be at or near
> the point of needing people actually trying to use it to see if there
> are problems with the the protocol.
> 
> If it's broken it should be a problem for toytoolkit apps and not
> anything anyone has out of tree.
> 
> If it were up to me, I'd probably let it in...  Strictly speaking
> though? Yeah, it's too late. :)

This echoes my own rationale.  Also it's been under review a good amount
of time already, and would be nice to see it landed.  However, pekka's
right that it's a lot of code to land just before the beta, and there's
still some questions and fixups left to do.  Coupled to the fact that
few people have the HW to be able to test this, it probably does make
most sense to hold this for next cycle.

> I kind of worry about our fixed release cycle and small number of
> developers.  Things like this (and atomic, heh) will now get shelved for
> quite some time and might not be anyone's priority anymore at the time
> we start merging features again.

This is a fair point.  When the duration of time needed to get a major
feature landed exceeds the duration of one's employment contract, that's
going to hamstring a lot of development effort...

I'm not sure we're actually to that point though.  But it probably would
behoove us to be more aggressive at landing WIP features when
development re-opens.

I think the problem is that folks who typically can land stuff, have
been doing so intently leading up to the release, and then once it's out
they're pretty tapped and want to shift their focus to other
non-maintenance work they've been neglecting.  (At least, such has been
the case for me...)

Bryce

> Thanks,
> Derek
> 
> >> On Fri, Jul 31, 2015 at 03:59:51PM +0200, Carlos Garnacho wrote:
> >>> The whole feature is exposed by the wl_pointer_gestures global
> >>> resource, which can be used to obtain individual swipe/pinch
> >>> gesture interfaces for a given wl_pointer.
> >>>
> >>> 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 protocol is marked as unstable, an is thus '_' prefixed, this
> >>> prefix will be removed when the protocol is deemed stable.
> >>>
> >>> v3: Reword exclusiveness of gestures and client-side semantics.
> >>>     specify further the "cancelled" field in end events. Renamed
> >>>     XML file to be more specific.
> >>> v2: Moved to an standalone xml
> >>>
> >>> Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
> >>> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> >>> ---
> >>>  Makefile.am                   |   3 +
> >>>  protocol/pointer-gestures.xml | 172 ++++++++++++++++++++++++++++++++++++++++++
> >>>  2 files changed, 175 insertions(+)
> >>>  create mode 100644 protocol/pointer-gestures.xml
> >>>
> >>> diff --git a/Makefile.am b/Makefile.am
> >>> index 76ab546..6334865 100644
> >>> --- a/Makefile.am
> >>> +++ b/Makefile.am
> >>> @@ -96,6 +96,8 @@ weston_SOURCES =					\
> >>>  	src/weston-egl-ext.h
> >>>  
> >>>  nodist_weston_SOURCES =					\
> >>> +	protocol/pointer-gestures-protocol.c		\
> >>> +	protocol/pointer-gestures-server-protocol.h	\
> >>>  	protocol/screenshooter-protocol.c		\
> >>>  	protocol/screenshooter-server-protocol.h	\
> >>>  	protocol/text-cursor-position-protocol.c	\
> >>> @@ -1298,6 +1300,7 @@ BUILT_SOURCES +=				\
> >>>  	protocol/text-client-protocol.h
> >>>  
> >>>  EXTRA_DIST +=					\
> >>> +	protocol/pointer-gestures.xml		\
> >>>  	protocol/desktop-shell.xml		\
> >>>  	protocol/screenshooter.xml		\
> >>>  	protocol/text.xml			\
> >>> diff --git a/protocol/pointer-gestures.xml b/protocol/pointer-gestures.xml
> >>> new file mode 100644
> >>> index 0000000..1bca8f7
> >>> --- /dev/null
> >>> +++ b/protocol/pointer-gestures.xml
> >>> @@ -0,0 +1,172 @@
> >>> +<protocol name="pointer_gestures">
> >>> +  <interface name="_wl_pointer_gestures" version="1">
> >>> +    <description summary="touchpad gestures">
> >>> +      A global interface to provide semantic touchpad gestures for a given
> >>> +      pointer.
> >>> +
> >>> +      Two gestures are currently supported: swipe and zoom/rotate.
> >>> +      All gestures follow a three-stage cycle: begin, update, end and
> >>> +      are identified by a unique id.
> >>> +
> >>> +      Warning! The protocol described in this file is experimental. Each
> >>> +      version of this protocol should be considered incompatible with any
> >>> +      other version, and a client binding to a version different to the one
> >>> +      advertised will be terminated. Once the protocol is declared stable,
> >>> +      compatibility is guaranteed, the '_' prefix will be removed from the
> >>> +      name and the version will be reset to 1.
> >>> +    </description>
> >>> +
> >>> +    <request name="get_swipe_gesture">
> >>> +      <description summary="get swipe gesture">
> >>> +	Create a swipe gesture object. See the
> >>> +	wl_pointer_gesture_swipe interface for details.
> >>> +      </description>
> >>> +      <arg name="id" type="new_id" interface="_wl_pointer_gesture_swipe"/>
> >>> +      <arg name="pointer" type="object" interface="wl_pointer"/>
> >>> +    </request>
> >>> +
> >>> +    <request name="get_pinch_gesture">
> >>> +      <description summary="get pinch gesture">
> >>> +	Create a pinch gesture object. See the
> >>> +	wl_pointer_gesture_pinch interface for details.
> >>> +      </description>
> >>> +      <arg name="id" type="new_id" interface="_wl_pointer_gesture_pinch"/>
> >>> +      <arg name="pointer" type="object" interface="wl_pointer"/>
> >>> +    </request>
> >>> +  </interface>
> >>> +
> >>> +  <interface name="_wl_pointer_gesture_swipe" version="1">
> >>> +    <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.
> >>> +      There cannot be multiple simultaneous pinch or swipe gestures on a
> >>> +      same pointer/seat, how compositors prevent these situations is
> >>> +      implementation-dependent.
> >>> +
> >>> +      A gesture may be cancelled by the compositor or the hardware.
> >>> +      Clients should not consider performing permanent or irreversible
> >>> +      actions until the end of a gesture has been received.
> >>> +    </description>
> >>> +
> >>> +    <request name="destroy" type="destructor">
> >>> +      <description summary="destroy the pointer swipe gesture object"/>
> >>> +    </request>
> >>> +
> >>> +    <event name="begin">
> >>> +      <description summary="multi-finger swipe begin">
> >>> +	This event is sent when a multi-finger swipe gesture is detected
> >>> +	on the device.
> >>> +      </description>
> >>> +      <arg name="serial" type="uint"/>
> >>> +      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
> >>> +      <arg name="surface" type="object" interface="wl_surface"/>
> >>> +      <arg name="fingers" type="uint" summary="number of fingers"/>
> >>> +    </event>
> >>> +
> >>> +    <event name="update">
> >>> +      <description summary="multi-finger swipe motion">
> >>> +	This event is sent when a multi-finger swipe gesture changes the
> >>> +	position of the logical center.
> >>> +
> >>> +	The dx and dy coordinates are relative coordinates of the logical
> >>> +	center of the gesture compared to the previous event.
> >>> +      </description>
> >>> +      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
> >>> +      <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
> >>> +      <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
> >>> +    </event>
> >>> +
> >>> +    <event name="end">
> >>> +      <description summary="multi-finger swipe end">
> >>> +	This event is sent when a multi-finger swipe gesture ceases to
> >>> +	be valid. This may happen when one or more finger is lifted or
> >>> +	the gesture is cancelled.
> >>> +
> >>> +	When a gesture is cancelled, the client should undo state changes
> >>> +	caused by this gesture. What causes a gesture to be cancelled is
> >>> +	implementation-dependent.
> >>> +      </description>
> >>> +      <arg name="serial" type="uint"/>
> >>> +      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
> >>> +      <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
> >>> +    </event>
> >>> +  </interface>
> >>> +
> >>> +  <interface name="_wl_pointer_gesture_pinch" version="1">
> >>> +    <description summary="a pinch gesture object">
> >>> +      A pinch 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.
> >>> +      There cannot be multiple simultaneous pinch or swipe gestures on a
> >>> +      same pointer/seat, how compositors prevent these situations is
> >>> +      implementation-dependent.
> >>> +
> >>> +      A gesture may be cancelled by the compositor or the hardware.
> >>> +      Clients should not consider performing permanent or irreversible
> >>> +      actions until the end of a gesture has been received.
> >>> +    </description>
> >>> +
> >>> +    <request name="destroy" type="destructor">
> >>> +      <description summary="destroy the pinch gesture object"/>
> >>> +    </request>
> >>> +
> >>> +    <event name="begin">
> >>> +      <description summary="multi-finger pinch begin">
> >>> +	This event is sent when a multi-finger pinch gesture is detected
> >>> +	on the device.
> >>> +      </description>
> >>> +      <arg name="serial" type="uint"/>
> >>> +      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
> >>> +      <arg name="surface" type="object" interface="wl_surface"/>
> >>> +      <arg name="fingers" type="uint" summary="number of fingers"/>
> >>> +    </event>
> >>> +
> >>> +    <event name="update">
> >>> +      <description summary="multi-finger pinch motion">
> >>> +	This event is sent when a multi-finger pinch gesture changes the
> >>> +	position of the logical center, the rotation or the relative scale.
> >>> +
> >>> +	The dx and dy coordinates are relative coordinates in the
> >>> +	surface coordinate space of the logical center of the gesture.
> >>> +
> >>> +	The scale factor is an absolute scale compared to the
> >>> +	pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
> >>> +	are now twice as far apart as on pointer_gesture_pinch.begin.
> >>> +
> >>> +	The rotation is the relative angle in degrees clockwise compared to the previous
> >>> +	pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
> >>> +      </description>
> >>> +      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
> >>> +      <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
> >>> +      <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
> >>> +      <arg name="scale" type="fixed" summary="scale relative to the initial finger position"/>
> >>> +      <arg name="rotation" type="fixed" summary="angle in degrees cw relative to the previous event"/>
> >>> +    </event>
> >>> +
> >>> +    <event name="end">
> >>> +      <description summary="multi-finger pinch end">
> >>> +	This event is sent when a multi-finger pinch gesture ceases to
> >>> +	be valid. This may happen when one or more finger is lifted or
> >>> +	the gesture is cancelled.
> >>> +
> >>> +	When a gesture is cancelled, the client should undo state changes
> >>> +	caused by this gesture. What causes a gesture to be cancelled is
> >>> +	implementation-dependent.
> >>> +      </description>
> >>> +      <arg name="serial" type="uint"/>
> >>> +      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
> >>> +      <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
> >>> +    </event>
> >>> +  </interface>
> >>> +</protocol>
> >>> -- 
> >>> 2.4.3
> >>>
> >>> _______________________________________________
> >>> wayland-devel mailing list
> >>> wayland-devel at lists.freedesktop.org
> >>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> >> _______________________________________________
> >> wayland-devel mailing list
> >> wayland-devel at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> > 
> > 
> > 
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> > 


More information about the wayland-devel mailing list