[PATCH weston 4/5] evdev: Improve touchpad support and add motion filters

Bill Spitzak spitzak at gmail.com
Tue May 15 10:43:44 PDT 2012


It really sounds like the compositor should do this. IMHO it should  
produce *lots* of input events, so these gestures can be recognized.  
It would produce scroll events or whatever at the correct speed (or  
with a 24_8 increment on each) so that the acceleration is exactly the  
same if the client obeys these. Note I don't know much about gestures  
so don't take this as an actual suggestion, just an indication of what  
I am thinking would work.

The main rule however is that it is trivial for a client to filter  
these events out and get only the raw events. This will allow them to  
do their own gestures or any other input processing. The compositor  
must not "eat" events.

Even for very old input devices Wayland should produce useful events:  
repeat events for keyboard keys, repeat for mouse buttons (so holding  
down a button widget repeats at the same rate for all apps), a "hover"  
event (or maybe several) so all clients agree when to popup a tooltip.  
An indication on mouse movement and button release as to whether it is  
a "click" or a "drag" so that all clients agree on mouse-shake  
removal. A clear indication of double-click on the second mouse-down  
so all clients agree on double-click speed.

And there is text input methods: keys would be marked as being eaten  
by a text input method, so the client could ignore them, and then text  
produced by the text input method would be sent as UTF-8 strings,  
along with an indicator if this replaces the previous text (to allow  
composition in-place without the horrible overlays that X tried to  
use).  (a problem is that clients need to control whether the input  
method is active and to be able to cancel it for any key, though I  
hope these can be async messages).

This would make writing simple clients a lot easier, and would make  
all clients agree to responses.

The problem is that it would require additions to the Wayland protocol  
as new ideas in input processing are invented. However I think as long  
as raw events are available clients can do these themselves until the  
ideas are worked out and it is added to Wayland.


On May 15, 2012, at 8:48 AM, Benjamin Otte wrote:

> On Tue, May 15, 2012 at 5:20 PM, Chase Douglas
> <chase.douglas at canonical.com> wrote:
>> The real issue is when you want to have object manipulation within an
>> application. Let's take smooth scrolling using a trackpad as an  
>> example.
>> One approach would be to use the same acceleration for scrolling as  
>> for
>> cursor motion. Scrolling should be performed by the client
>> application/toolkit, so the client needs to have access to the
>> acceleration algorithm.
>>
>> Further, there's a good argument to be made for splitting it out  
>> since
>> there will not be one single "Wayland" compositor. Why not provide a
>> library so that all compositors can benefit without reinventing the  
>> wheel?
>>
> It gets even more interesting when your application is supposed to use
> the same pointer acceleration code as the compositor, but your
> application wants to work with different compositors that all use
> slightly different acceleration methods...
>
> In general, I've been very unhappy about the cases where I had to
> emulate acceleration myself, because (a) it depends on the server and
> (b) it requires lots of extra work where everything else just works.
> The examples I tried were swipes (for scrolling or to move the slider
> of a GtkPaned or GtkScrollbar) and the pinch/pan gestures used to
> navigate web pages on tablets or phones, but I'm sure people can come
> up with myriads of examples here.
>
> With the newer interaction patterns on pointer devices, I'm also very
> interested in not only position, but also velocity and acceleration to
> enable the kinetic behavior that people expect on those devices. And
> I'm pretty sure if all the running applications and the compositor
> feel the same way, no matter if you throw a window, a DND object, a
> scrolled area or a slider to the left and no matter if you throw it
> with a mouse, via a touchpad or directly with your finger.
>
> Benjamin
> _______________________________________________
> 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