[PATCH v2 wayland 4/5] protocol: add axis_source.wheel_tilt

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 12 05:28:55 UTC 2017


On Thu, Jan 12, 2017 at 10:13:30AM +1000, Peter Hutterer wrote:
> Unlike a wheel rotation, a wheel tilt is a discrete-only axis. Wheel rotations
> are mapped to degrees in libinput but that that does not apply to wheel tilt
> axes where there is no physical equivalent.

before I forget: I did *not* bump the interface version because we already
did for the touchpoint extensions (see 6a18a87727c6) and we haven't had a
release since.

Cheers,
   Peter

> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> Reviewed-by: Jonas Ã…dahl <jadahl at gmail.com>
> Acked-by: Daniel Stone <daniels at collabora.com>
> ---
> Changes to v1:
> - more commit message goodness
> - sync the test-scanner data files for new output
> 
>  protocol/wayland.xml        | 10 ++++++++--
>  tests/data/example-client.h | 16 +++++++++++++++-
>  tests/data/example-server.h | 13 +++++++++++++
>  tests/data/example.xml      |  8 +++++++-
>  4 files changed, 43 insertions(+), 4 deletions(-)
> 
> diff --git a/protocol/wayland.xml b/protocol/wayland.xml
> index 098f286..29b63be 100644
> --- a/protocol/wayland.xml
> +++ b/protocol/wayland.xml
> @@ -1986,10 +1986,15 @@
>  	finger. One example for this source is button-based scrolling where
>  	the vertical motion of a device is converted to scroll events while
>  	a button is held down.
> +
> +	The "wheel tilt" axis source indicates that the actual device is a
> +	wheel but the scroll event is not caused by a rotation but a
> +	(usually sideways) tilt of the wheel.
>        </description>
> -      <entry name="wheel" value="0" summary="a physical wheel" />
> +      <entry name="wheel" value="0" summary="a physical wheel rotation" />
>        <entry name="finger" value="1" summary="finger on a touch surface" />
>        <entry name="continuous" value="2" summary="continuous coordinate space"/>
> +      <entry name="wheel_tilt" value="3" summary="a physical wheel tilt" since="6"/>
>      </enum>
>  
>      <event name="axis_source" since="5">
> @@ -2004,7 +2009,8 @@
>  	wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be
>  	sent when the user lifts the finger off the device.
>  
> -	If the source is wl_pointer axis_source.wheel or
> +	If the source is wl_pointer.axis_source.wheel,
> +	wl_pointer.axis_source.wheel_tilt or
>  	wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may
>  	or may not be sent. Whether a compositor sends an axis_stop event
>  	for these sources is hardware-specific and implementation-dependent;
> diff --git a/tests/data/example-client.h b/tests/data/example-client.h
> index b1d23f9..56f9bfe 100644
> --- a/tests/data/example-client.h
> +++ b/tests/data/example-client.h
> @@ -4044,6 +4044,10 @@ enum wl_pointer_axis {
>   * finger. One example for this source is button-based scrolling where
>   * the vertical motion of a device is converted to scroll events while
>   * a button is held down.
> + *
> + * The "wheel tilt" axis source indicates that the actual device is a
> + * wheel but the scroll event is not caused by a rotation but a
> + * (usually sideways) tilt of the wheel.
>   */
>  enum wl_pointer_axis_source {
>  	/**
> @@ -4058,7 +4062,16 @@ enum wl_pointer_axis_source {
>  	 * continuous coordinate space
>  	 */
>  	WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
> +	/**
> +	 * a physical wheel tilt
> +	 * @since 6
> +	 */
> +	WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
>  };
> +/**
> + * @ingroup iface_wl_pointer
> + */
> +#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
>  #endif /* WL_POINTER_AXIS_SOURCE_ENUM */
>  
>  /**
> @@ -4225,7 +4238,8 @@ struct wl_pointer_listener {
>  	 * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event
>  	 * will be sent when the user lifts the finger off the device.
>  	 *
> -	 * If the source is wl_pointer axis_source.wheel or
> +	 * If the source is wl_pointer.axis_source.wheel,
> +	 * wl_pointer.axis_source.wheel_tilt or
>  	 * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event
>  	 * may or may not be sent. Whether a compositor sends an axis_stop
>  	 * event for these sources is hardware-specific and
> diff --git a/tests/data/example-server.h b/tests/data/example-server.h
> index f7190fd..56cc83f 100644
> --- a/tests/data/example-server.h
> +++ b/tests/data/example-server.h
> @@ -3253,6 +3253,10 @@ enum wl_pointer_axis {
>   * finger. One example for this source is button-based scrolling where
>   * the vertical motion of a device is converted to scroll events while
>   * a button is held down.
> + *
> + * The "wheel tilt" axis source indicates that the actual device is a
> + * wheel but the scroll event is not caused by a rotation but a
> + * (usually sideways) tilt of the wheel.
>   */
>  enum wl_pointer_axis_source {
>  	/**
> @@ -3267,7 +3271,16 @@ enum wl_pointer_axis_source {
>  	 * continuous coordinate space
>  	 */
>  	WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
> +	/**
> +	 * a physical wheel tilt
> +	 * @since 6
> +	 */
> +	WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
>  };
> +/**
> + * @ingroup iface_wl_pointer
> + */
> +#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
>  #endif /* WL_POINTER_AXIS_SOURCE_ENUM */
>  
>  /**
> diff --git a/tests/data/example.xml b/tests/data/example.xml
> index 0ad2577..dc625b9 100644
> --- a/tests/data/example.xml
> +++ b/tests/data/example.xml
> @@ -1988,10 +1988,15 @@
>  	finger. One example for this source is button-based scrolling where
>  	the vertical motion of a device is converted to scroll events while
>  	a button is held down.
> +
> +	The "wheel tilt" axis source indicates that the actual device is a
> +	wheel but the scroll event is not caused by a rotation but a
> +	(usually sideways) tilt of the wheel.
>        </description>
>        <entry name="wheel" value="0" summary="a physical wheel rotation" />
>        <entry name="finger" value="1" summary="finger on a touch surface" />
>        <entry name="continuous" value="2" summary="continuous coordinate space"/>
> +      <entry name="wheel_tilt" value="3" summary="a physical wheel tilt" since="6"/>
>      </enum>
>  
>      <event name="axis_source" since="5">
> @@ -2006,7 +2011,8 @@
>  	wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be
>  	sent when the user lifts the finger off the device.
>  
> -	If the source is wl_pointer axis_source.wheel or
> +	If the source is wl_pointer.axis_source.wheel,
> +	wl_pointer.axis_source.wheel_tilt or
>  	wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may
>  	or may not be sent. Whether a compositor sends an axis_stop event
>  	for these sources is hardware-specific and implementation-dependent;
> -- 
> 2.9.3
> 


More information about the wayland-devel mailing list