From 679872a8007f512be1882b0de7a733b34968cfbf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 May 2017 16:34:10 -0400 Subject: [PATCH] elput: group tablet input devices into pointer devices this is consistent with x11 behavior as well as the behavior of other toolkits under wayland @feature --- src/lib/elput/elput_evdev.c | 20 ++++++++++++-------- src/lib/elput/elput_private.h | 5 ++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index 9a2dc5c443..16157440ae 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c @@ -1265,21 +1265,25 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device) if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) && (libinput_device_pointer_has_button(device, BTN_LEFT)))) + edev->caps |= EVDEV_SEAT_POINTER; + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL)) + edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_TOOL; + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD)) + edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_PAD; + if (edev->caps & EVDEV_SEAT_POINTER) { _pointer_init(seat); edev->caps |= EVDEV_SEAT_POINTER; } if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) - { - _touch_init(seat); - edev->caps |= EVDEV_SEAT_TOUCH; - } + edev->caps |= EVDEV_SEAT_TOUCH; + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE)) + edev->caps |= EVDEV_SEAT_TOUCH | EVDEV_SEAT_GESTURE; + if (edev->caps & EVDEV_SEAT_TOUCH) + _touch_init(seat); - if (!((edev->caps & EVDEV_SEAT_KEYBOARD) || - (edev->caps & EVDEV_SEAT_POINTER) || - (edev->caps & EVDEV_SEAT_TOUCH))) - goto err; + if (!edev->caps) goto err; libinput_device_set_user_data(device, edev); libinput_device_ref(edev->device); diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h index 51c6f0ab07..217383fa7a 100644 --- a/src/lib/elput/elput_private.h +++ b/src/lib/elput/elput_private.h @@ -63,7 +63,10 @@ typedef enum _Elput_Device_Capability { EVDEV_SEAT_POINTER = (1 << 0), EVDEV_SEAT_KEYBOARD = (1 << 1), - EVDEV_SEAT_TOUCH = (1 << 2) + EVDEV_SEAT_TOUCH = (1 << 2), + EVDEV_SEAT_TABLET_TOOL = (1 << 3), + EVDEV_SEAT_TABLET_PAD = (1 << 4), + EVDEV_SEAT_GESTURE = (1 << 5), } Elput_Device_Capability; typedef struct _Elput_Interface