From 1ef773be76ec0f45312622da7720ae6917bdf789 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 29 Jul 2017 12:34:49 +0100 Subject: [PATCH] protocol: add wl_pointer's axis relative physical direction This event adds the physical direction of the axis motion, relative to the axis event we get. Right now, when natural scrolling is enabled things like virtual volume sliders move the wrong way round. By adding the axis motion direction, we can have toolkits swap the scroll direction for applicable widgets, getting the right behavior on all widgets. Signed-off-by: Peter Hutterer Reviewed-by: Yong Bakos --- protocol/wayland.xml | 64 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index c8ba3aed..f32a5a53 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -1825,7 +1825,7 @@ - + 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 @@ -1958,7 +1958,7 @@ - + The wl_pointer interface represents one or more input devices, such as mice, which control the pointer location and pointer_focus @@ -2315,9 +2315,65 @@ + + + + + + This specifies the direction of the physical motion that caused a + wl_pointer.axis event, relative to the wl_pointer.axis direction. + + + + + + + + Relative directional information of the entity causing the axis + motion. + + For a wl_pointer.axis event, the wl_pointer.axis_relative_direction + event specifies the movement direction of the entity causing the + wl_pointer.axis event. For example: + - if a user's fingers on a touchpad move down and this + causes a wl_pointer.axis vertical_scroll down event, the physical + direction is 'identical' + - if a user's fingers on a touchpad move down and this causes a + wl_pointer.axis vertical_scroll up scroll up event ('natural + scrolling'), the physical direction is 'inverted'. + + A client may use this information to adjust scroll motion of + components. Specifically, enabling natural scrolling causes the + content to change direction compared to traditional scrolling. + Some widgets like volume control sliders should usually match the + physical direction regardless of whether natural scrolling is + active. This event enables clients to match the scroll direction of + a widget to the physical direction. + + This event does not occur on its own, it is coupled with a + wl_pointer.axis event that represents this axis value. + The protocol guarantees that each axis_relative_direction event is + always followed by exactly one axis event with the same + axis number within the same wl_pointer.frame. Note that the protocol + allows for other events to occur between the axis_relative_direction + and its coupled axis event. + + The axis number is identical to the axis number in the associated + axis event. + + The order of wl_pointer.axis_relative_direction, + wl_pointer.axis_discrete and wl_pointer.axis_source is not + guaranteed. + + + + - + The wl_keyboard interface represents one or more keyboards associated with a seat. @@ -2444,7 +2500,7 @@ - + The wl_touch interface represents a touchscreen associated with a seat.