Hi,
On 25-02-15 08:39, Peter Hutterer wrote:
subject should be "evdev: force-assign 10 slots to mtdev devices"
fixed locally.
With that fixed both patches look good and are:
Reviewed-by: Hans de Goede <hdego...@redhat.com>
Regards,
Hans
Cheers,
Peter
On Wed, Feb 25, 2015 at 05:37:25PM +1000, Peter Hutterer wrote:
If the device doesn't have any slots, mtdev->caps.slot.maximum is 0. Since we
only use mtdev if we don't have slots, this caused protocol A devices to
always fail.
https://bugs.freedesktop.org/show_bug.cgi?id=89211
Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
src/evdev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/evdev.c b/src/evdev.c
index cf21d2e..a0c020b 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -524,6 +524,14 @@ evdev_process_touch(struct evdev_device *device,
{
switch (e->code) {
case ABS_MT_SLOT:
+ if ((size_t)e->value >= device->mt.slots_len) {
+ log_bug_libinput(device->base.seat->libinput,
+ "%s exceeds slots (%d of %d)\n",
+ device->devname,
+ e->value,
+ device->mt.slots_len);
+ e->value = device->mt.slots_len - 1;
+ }
evdev_flush_pending_event(device, time);
device->mt.slot = e->value;
break;
@@ -1467,10 +1475,9 @@ evdev_configure_device(struct evdev_device *device)
if (!device->mtdev)
return -1;
- num_slots = device->mtdev->caps.slot.maximum;
- if (device->mtdev->caps.slot.minimum < 0 ||
- num_slots <= 0)
- return -1;
+ /* pick 10 slots as default for type A
+ devices. */
+ num_slots = 10;
active_slot = device->mtdev->caps.slot.value;
} else {
num_slots =
libevdev_get_num_slots(device->evdev);
--
2.1.0
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel