summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:34:10 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:27:42 -0400
commit679872a8007f512be1882b0de7a733b34968cfbf (patch)
treea4afce98aa73016b8f2d66d84d99a41ff670c58f
parent859b5a04236db40a3edecf4aa0162f0fe26cc818 (diff)
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
-rw-r--r--src/lib/elput/elput_evdev.c20
-rw-r--r--src/lib/elput/elput_private.h5
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)
1265 1265
1266 if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) && 1266 if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) &&
1267 (libinput_device_pointer_has_button(device, BTN_LEFT)))) 1267 (libinput_device_pointer_has_button(device, BTN_LEFT))))
1268 edev->caps |= EVDEV_SEAT_POINTER;
1269 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL))
1270 edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_TOOL;
1271 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD))
1272 edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_PAD;
1273 if (edev->caps & EVDEV_SEAT_POINTER)
1268 { 1274 {
1269 _pointer_init(seat); 1275 _pointer_init(seat);
1270 edev->caps |= EVDEV_SEAT_POINTER; 1276 edev->caps |= EVDEV_SEAT_POINTER;
1271 } 1277 }
1272 1278
1273 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) 1279 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
1274 { 1280 edev->caps |= EVDEV_SEAT_TOUCH;
1275 _touch_init(seat); 1281 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE))
1276 edev->caps |= EVDEV_SEAT_TOUCH; 1282 edev->caps |= EVDEV_SEAT_TOUCH | EVDEV_SEAT_GESTURE;
1277 } 1283 if (edev->caps & EVDEV_SEAT_TOUCH)
1284 _touch_init(seat);
1278 1285
1279 if (!((edev->caps & EVDEV_SEAT_KEYBOARD) || 1286 if (!edev->caps) goto err;
1280 (edev->caps & EVDEV_SEAT_POINTER) ||
1281 (edev->caps & EVDEV_SEAT_TOUCH)))
1282 goto err;
1283 1287
1284 libinput_device_set_user_data(device, edev); 1288 libinput_device_set_user_data(device, edev);
1285 libinput_device_ref(edev->device); 1289 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
63{ 63{
64 EVDEV_SEAT_POINTER = (1 << 0), 64 EVDEV_SEAT_POINTER = (1 << 0),
65 EVDEV_SEAT_KEYBOARD = (1 << 1), 65 EVDEV_SEAT_KEYBOARD = (1 << 1),
66 EVDEV_SEAT_TOUCH = (1 << 2) 66 EVDEV_SEAT_TOUCH = (1 << 2),
67 EVDEV_SEAT_TABLET_TOOL = (1 << 3),
68 EVDEV_SEAT_TABLET_PAD = (1 << 4),
69 EVDEV_SEAT_GESTURE = (1 << 5),
67} Elput_Device_Capability; 70} Elput_Device_Capability;
68 71
69typedef struct _Elput_Interface 72typedef struct _Elput_Interface