[PATCH libinput 2/8] evdev: Avoid double touch down/up events

Michael Schellenberger Costa schellenberger at inb.uni-luebeck.de
Tue Mar 25 23:45:32 PDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I might be dumb but doesnt this require motion between clicks?

In that case you would lose for example track balls which do not
necessary move between clicks.

Best wishes
Michael


On 25.03.2014 21:45, Jonas Ådahl wrote:
> When the kernel sends multiple touch down or touch up for the same
> slot in a row, ignore any such subsequent event ensuring libinput
> always produces 1 x touch down -> [n x touch motion] -> 1 x touch
> up event series.
> 
> Signed-off-by: Jonas Ådahl <jadahl at gmail.com> --- src/evdev.c | 13
> +++++++++++++ 1 file changed, 13 insertions(+)
> 
> diff --git a/src/evdev.c b/src/evdev.c index ff8b27a..729e1f4
> 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -135,6 +135,9 @@
> evdev_flush_pending_event(struct evdev_device *device, uint32_t
> time) if (slot >= MAX_SLOTS) break;
> 
> +		if (device->mt.slots[slot].seat_slot != -1) +			break; + 
> seat_slot = ffs(~seat->slot_map) - 1; 
> device->mt.slots[slot].seat_slot = seat_slot;
> 
> @@ -171,6 +174,7 @@ evdev_flush_pending_event(struct evdev_device
> *device, uint32_t time) break;
> 
> seat_slot = device->mt.slots[slot].seat_slot; +
> device->mt.slots[slot].seat_slot = -1;
> 
> if (seat_slot == -1) break; @@ -183,6 +187,9 @@
> evdev_flush_pending_event(struct evdev_device *device, uint32_t
> time) if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) break;
> 
> +		if (device->abs.seat_slot != -1) +			break; + seat_slot =
> ffs(~seat->slot_map) - 1; device->abs.seat_slot = seat_slot;
> 
> @@ -218,6 +225,7 @@ evdev_flush_pending_event(struct evdev_device
> *device, uint32_t time) break;
> 
> seat_slot = device->abs.seat_slot; +		device->abs.seat_slot = -1;
> 
> if (seat_slot == -1) break; @@ -655,6 +663,7 @@
> evdev_device_create(struct libinput_seat *seat, int rc; int fd; int
> unhandled_device = 0; +	int i;
> 
> /* Use non-blocking mode so that we can loop on read on *
> evdev_device_data() until all events on the fd are @@ -712,6
> +721,10 @@ evdev_device_create(struct libinput_seat *seat, if
> (!device->source) goto err;
> 
> +	device->abs.seat_slot = -1; +	for (i = 0; i < MAX_SLOTS; ++i) +
> device->mt.slots[i].seat_slot = -1; + 
> list_insert(seat->devices_list.prev, &device->base.link); 
> notify_added_device(&device->base);
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTMneIAAoJECfkpCAi2eFKXz8H/1POqiyC9VllwxI9PUKqX/bp
anHZinbHqXnj5275/RRxuGwtrRWhPNz/29bv/xSqZUF6gGXfaOJnoyNdpcYc59Lv
CMtLh3JlIMy2brPSlw+0FOg4E+CLk/8xN2L0z0I2JnpU3rvcrpUlaKnmbILTuexB
jyMWZYD8HsrlfAPlvbvIwCHSayhWzDoT7akgo0q52F9XuZ3NNCr/U1ieBZWiTK9O
3gCldrNIwq8ucdtKYbtS+Uw1pvCTRK+teEam/jn6ZkgZ42TsccnXpm9FQTuKUFAR
rtg0Bv1QBu7Q08VyHJRs6TVghWd1gD6oddyIXWhPbEKJn1nyntGFT3y7yepysyc=
=V1T3
-----END PGP SIGNATURE-----


More information about the wayland-devel mailing list