[PATCH weston v3 1/5] protocol: Add _wl_pointer_gestures (swipe/pinch) protocol
Derek Foreman
derekf at osg.samsung.com
Thu Aug 27 09:11:29 PDT 2015
On 31/07/15 04:19 PM, Bill Spitzak wrote:
>
>
> On Fri, Jul 31, 2015 at 6:59 AM, Carlos Garnacho <carlosg at gnome.org
> <mailto:carlosg at gnome.org>> wrote:
>
>
> + <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>
>
>
> This is something that would have to be changed in libinput, but it
> would be a lot easier on clients if the data was consistently relative
> to the initial begin event, rather than the scale being relative to the
> begin event while the rotation is relative to the previous event. Also
> it would be nice if the rotation was counter-clockwise as that is what
> positive angles mean in most graphics libraries.
Why would this need to be changed in libinput?
We could sum the rotation events ourselves (in the compositor) to make
them relative to the initial event, could we not?
And converting cw to ccw would just be flipping the sign?
I do wonder how quickly roundoff error will accumulate with relative
rotation events, but it's not like I'm going to spin my arm through
10000 degrees of rotation... (will rotation really go back to zero if my
fingers make it back to their starting points though?) But that's a
libinput question and unrelated to this protocol.
More information about the wayland-devel
mailing list