[PATCH weston v2 2/2] libinput: Only forward first and last press and release for a key

Bryce Harrington bryce at osg.samsung.com
Wed Feb 4 19:41:13 PST 2015


On Tue, Feb 03, 2015 at 05:01:30PM -0600, Derek Foreman wrote:
> fwiw,
> 
> Reviewed-by: Derek Foreman <derekf at osg.samsung.com>
> 
> for both.
> 
> On 29/01/15 10:23 PM, Jonas Ådahl wrote:
> > Keyboard key events will be received from a device where a key has
> > been pressed, even though an equivalent key has been pressed (same
> > key code) on a device connected to the same seat. notify_key()
> > expects to only be called as if there was only one keyboard device
> > associated with the given seat, so to achieve this, ignore every event
> > where forwarding it would result in multiple 'pressed' or 'released'
> > notifications.
> > 
> > Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
> > Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> > Reviewed-by: Daniel Stone <daniels at collabora.com>

Thanks, applied.

   6b4b241..90d1ac8  master -> master


> > ---
> > 
> > Changed since v1:
> > 
> > New commit message subject
> > 
> > 
> >  src/libinput-device.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/src/libinput-device.c b/src/libinput-device.c
> > index 5c5b9b9..567e5ea 100644
> > --- a/src/libinput-device.c
> > +++ b/src/libinput-device.c
> > @@ -59,6 +59,17 @@ handle_keyboard_key(struct libinput_device *libinput_device,
> >  {
> >  	struct evdev_device *device =
> >  		libinput_device_get_user_data(libinput_device);
> > +	int key_state =
> > +		libinput_event_keyboard_get_key_state(keyboard_event);
> > +	int seat_key_count =
> > +		libinput_event_keyboard_get_seat_key_count(keyboard_event);
> > +
> > +	/* Ignore key events that are not seat wide state changes. */
> > +	if ((key_state == LIBINPUT_KEY_STATE_PRESSED &&
> > +	     seat_key_count != 1) ||
> > +	    (key_state == LIBINPUT_KEY_STATE_RELEASED &&
> > +	     seat_key_count != 0))
> > +		return;
> >  
> >  	notify_key(device->seat,
> >  		   libinput_event_keyboard_get_time(keyboard_event),
> > 
> 
> _______________________________________________
> 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