[PATCH libinput 1/4] evdev: Ignore key/button release events if key was never pressed

Peter Hutterer peter.hutterer at who-t.net
Sun Aug 3 22:07:35 PDT 2014


On Mon, Jul 28, 2014 at 10:03:25AM -0700, Bill Spitzak wrote:
> 
> 
> On 07/27/2014 11:48 PM, Ran Benita wrote:
> >Hi Jonas,
> >
> >On Sun, Jul 27, 2014 at 11:28:28PM +0200, Jonas Ådahl wrote:
> >>The kernel may send a 'release' event without ever having sent a key
> >>'pressed' event in case the key was pressed before libinput was
> >>initiated. Ignore these events so that we always guarantee a release
> >>event always comes after a pressed event for any given key or button.
> >
> >Would it be possible to describe in the docs the invariants that
> >libinput is keeping w.r.t. key press/release ordering and count?
> >If the user can rely on such invariants, it can simplify how he
> >interfaces with e.g. libxkbcommon, which expects a coherent key event
> >stream (things like modifier press with a missed release can cause some
> >fun).
> 
> IMHO such invariants are a waste of time, and add complexity to each
> software layer for no benefit.

strict, well-defined behaviour that maps the real world and expectations of
the users and developers and guarantees no suprises is not a waste of time.

Cheers,
   Peter

> The final consumer of the events either can easily handle mismatched pairs,
> or is forced to implement the map of currently-pressed events anyway (due to
> the client having it's own internal routing of events which also has to
> match pairs, such as when objects that receive events are created or
> deleted). So there is no reason to waste effort implementing these maps at
> every level since in effect the next level is not going to rely on them.
> 
> I would prefer a count of the number of down buttons, which will allow a
> layer to re-sync it's map in many cases, even if events were mishandled by
> intermediate software layers.
> 
> _______________________________________________
> 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