<p dir="ltr"><br>
On Mar 24, 2015 6:14 PM, "Jonas Ådahl" <<a href="mailto:jadahl@gmail.com">jadahl@gmail.com</a>> wrote:<br>
><br>
> On Wed, Mar 25, 2015 at 10:27:10AM +1000, Peter Hutterer wrote:<br>
> > The axis_source event determines how an axis event was generated. This enables<br>
> > clients to judge when to use kinetic scrolling.<br>
> ><br>
> > The axis_stop event notifies a client about the termination of a scroll<br>
> > sequence, likewise needed to calculate kinetic scrolling parameters.<br>
> ><br>
> > The axis_discrete event provides the wheel click count. Previously the axis<br>
> > value was some hardcoded number (10), with the discrete steps this enables a<br>
> > client to differ between line-based scrolling on a mouse wheel and smooth<br>
> > scrolling with a touchpad.<br>
> ><br>
> > We can't extend the existing wl_pointer.axis events so we introduce a new<br>
> > concept: latching events. These events (axis_source and axis_discrete)<br>
> > are prefixed before a wl_pointer.axis or axis_stop event, i.e. the sequence<br>
> > becomes:<br>
> ><br>
> > wl_pointer.axis_source<br>
> > wl_pointer.axis<br>
> > wl_pointer.axis_source<br>
> > wl_pointer.axis<br>
> > wl_pointer.axis_source<br>
> > wl_pointer.axis<br>
> > wl_pointer.axis_source<br>
> > wl_pointer.axis_stop<br>
> ><br>
> > or:<br>
> ><br>
> > wl_pointer.axis_source<br>
> > wl_pointer.axis_discrete<br>
> > wl_pointer.axis_axis<br>
> ><br>
> > Clients need to combine the state of all events where needed.<br>
> > ---<br>
> > Changes to v1:<br>
> > - introduce axis_stop and axis_discrete as separate events instead of flags<br>
> > - couple of documentation updates<br>
> > - wl_seat/keyboard/touch/pointer bumped to version 5<br>
> ><br>
> > This is for the API review only so far, I don't have the weston patches to<br>
> > match yet.<br>
> ><br>
> > protocol/wayland.xml | 87 +++++++++++++++++++++++++++++++++++++++++++++++++---<br>
> > 1 file changed, 83 insertions(+), 4 deletions(-)<br>
> ><br>
> > diff --git a/protocol/wayland.xml b/protocol/wayland.xml<br>
> > index c5963e8..29e6f01 100644<br>
> > --- a/protocol/wayland.xml<br>
> > +++ b/protocol/wayland.xml<br>
> > @@ -1337,7 +1337,7 @@<br>
> > wl_seat.get_keyboard or wl_seat.get_touch, the returned object is<br>
> > always of the same version as the wl_seat.<br>
> > --><br>
> > - <interface name="wl_seat" version="4"><br>
> > + <interface name="wl_seat" version="5"><br>
> > <description summary="group of input devices"><br>
> > A seat is a group of keyboards, pointer and touch devices. This<br>
> > object is published as a global during start up, or when such a<br>
> > @@ -1411,7 +1411,7 @@<br>
> > </interface><br>
> ><br>
> > <!-- for the version see the comment in wl_seat --><br>
> > - <interface name="wl_pointer" version="3"><br>
> > + <interface name="wl_pointer" version="5"><br>
> > <description summary="pointer input device"><br>
> > The wl_pointer interface represents one or more input devices,<br>
> > such as mice, which control the pointer location and pointer_focus<br>
> > @@ -1572,10 +1572,89 @@<br>
> > <description summary="release the pointer object"/><br>
> > </request><br>
> ><br>
> > + <!-- Version 4 additions: none --><br>
><br>
> Usually don't tend to add these it seems. If we'd want to be consistent,<br>
> we'd have to add comments like this in several other places.<br>
><br>
> > +<br>
> > + <!-- Version 5 additions --><br>
> > +<br>
> > + <enum name="axis_source"><br>
> > + <description summary="axis source types"><br>
> > + Describes the axis types of scroll events.<br>
> > + </description><br>
> > + <entry name="unknown" value="0"/><br>
> > + <entry name="wheel" value="1"/><br>
> > + <entry name="finger" value="2"/><br>
> > + <entry name="continuous" value="3"/><br>
> > + </enum><br>
> > +<br>
> > + <event name="axis_source" since="5"><br>
> > + <description summary="axis source event"><br>
> > + Scroll and other axis source notification.<br>
> > +<br>
> > + This event does not occur on its own. It is sent before a<br>
> > + wl_pointer.axis or wl_pointer.axis_stop event and carries the source<br>
> > + information for that event. A client is expected to accumulate the<br>
> > + data in both events before proceeding.<br>
> > +<br>
> > + The axis and timestamp values are identical to the one in the<br>
> > + subsequent wl_pointer.axis or wl_pointer.axis_stop event. For the<br>
> > + interpretation of the axis value, see the wl_pointer.axis event<br>
> > + documentation.<br>
> > +<br>
> > + The source specifies how this event was generated. If the source is<br>
> > + finger, a wl_pointer.axis_stop event will be sent when the user<br>
> > + lifts the finger off the device.<br>
> > + </description><br>
> > + <arg name="time" type="uint" summary="timestamp with millisecond granularity"/><br>
><br>
> Why have a "time" parameter here, considering that this state does<br>
> nothing on its own and which data should simply be just kept around until<br>
> the committing event is received? Feels redundant.</p>
<p dir="ltr">Definitely. a) it's redundant and b) it creates confusion where the user wonders what they should do with all those timestamps.</p>
<p dir="ltr">> > + <arg name="axis" type="uint"/><br>
><br>
> This one seems also redundant.</p>
<p dir="ltr">I agree. You could make some case about sending all the source events then the discrete events and then axis events. However I see no advantage to this. If we want these events to act as "optional arguments" to the primary axis event then they should just all come in a clump.</p>
<p dir="ltr">> > + <arg name="axis_source" type="uint"/><br>
> > + </event><br>
> > +<br>
> > + <event name="axis_stop" since="5"><br>
> > + <description summary="axis stop event"><br>
> > + Scroll and other axis stop notification.<br>
> > +<br>
> > + For some wl_pointer.axis_source type, a wl_pointer.axis_stop event<br>
> > + is sent to notify a client that the axis sequence has terminated.<br>
> > + This enables the client to implement kinetic scrolling.<br>
> > + See the wl_pointer.axis_source documentation for information on when<br>
> > + this event may be generated.<br>
> > +<br>
> > + Any wl_pointer.axis events after this event should be considered as<br>
> > + the start of a new axis motion.<br>
> > +<br>
> > + The axis and timestamp values are to be interpreted identical to the<br>
> > + ones in the wl_pointer.axis event.<br>
> > + </description><br>
> > + <arg name="time" type="uint" summary="timestamp with millisecond granularity"/><br>
> > + <arg name="axis" type="uint"/><br>
><br>
> Same as axis_source::time and axis_source.axis.<br>
><br>
> > + </event><br>
> > +<br>
> > + <event name="axis_discrete" since="5"><br>
> > + <description summary="axis click event"><br>
> > + Scroll and other axis discrete step information.<br>
> > +<br>
> > + This event does not occur on its own. It is sent before a<br>
> > + wl_pointer.axis event and carries the axis value of the<br>
> > + wl_pointer.axis event in discrete steps (e.g. mouse wheel clicks).<br>
> > +<br>
> > + This event is optional, continuous scrolling devices<br>
> > + like two-finger scrolling on touchpads do not have discrete<br>
> > + steps.<br>
><br>
> Hmm. This means we wouldn't be able to convert the touch based scroll<br>
> motions into the old scroll step clicks, since we wouldn't (reliably)<br>
> know when a device would emit their own, since it doesn't specify<br>
> exactly when to expect and not to expect. The client won't know whether<br>
> there are "continuous scrolling devices" or not.<br>
><br>
> Wouldn't it be easier to just provide XI2 style smooth scroll vectors,<br>
> i.e. steps in "discrete scale", where a mouse scroll click is -1.0 or<br>
> 1.0 and continuous scrolling is a fraction of such. Clients implementing<br>
> version 5 can simply use the accumulation method for emitting scroll<br>
> clicks without having to rely on the old "divide by 10" hack.<br>
><br>
> This event is actually more like what I described in my previous mail<br>
> that were more or less concluded to be not worth it, isn't it?<br>
><br>
> > +<br>
> > + The axis and timestamp values are to be interpreted identical to the<br>
> > + ones in the wl_pointer.axis event.<br>
> > +<br>
> > + The discrete value carries the directional information. e.g. a value<br>
> > + of -2 is two steps towards the negative direction of this axis.<br>
> > + <arg name="time" type="uint" summary="timestamp with millisecond granularity"/><br>
> > + <arg name="axis" type="uint"/><br>
><br>
> Same as axis_source::time and axis_source.axis.<br>
><br>
><br>
> Jonas<br>
><br>
> > + <arg name="discrete" type="int"/><br>
> > + </description><br>
> > + </event><br>
> > </interface><br>
> ><br>
> > <!-- for the version see the comment in wl_seat --><br>
> > - <interface name="wl_keyboard" version="4"><br>
> > + <interface name="wl_keyboard" version="5"><br>
> > <description summary="keyboard input device"><br>
> > The wl_keyboard interface represents one or more keyboards<br>
> > associated with a seat.<br>
> > @@ -1690,7 +1769,7 @@<br>
> > </interface><br>
> ><br>
> > <!-- for the version see the comment in wl_seat --><br>
> > - <interface name="wl_touch" version="3"><br>
> > + <interface name="wl_touch" version="5"><br>
> > <description summary="touchscreen input device"><br>
> > The wl_touch interface represents a touchscreen<br>
> > associated with a seat.<br>
> > --<br>
> > 2.3.3<br>
> ><br>
</p>