mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 01:10:08 +01:00
test: use the udev property to check for external/internal touchpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
5307051386
commit
b69cfccdca
1 changed files with 18 additions and 2 deletions
|
|
@ -61,6 +61,22 @@ START_TEST(device_sendevents_config_invalid)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
static inline bool
|
||||
touchpad_is_external(struct litest_device *dev)
|
||||
{
|
||||
struct udev_device *udev_device;
|
||||
const char *prop;
|
||||
bool is_external;
|
||||
|
||||
udev_device = libinput_device_get_udev_device(dev->libinput_device);
|
||||
prop = udev_device_get_property_value(udev_device,
|
||||
"ID_INPUT_TOUCHPAD_INTEGRATION");
|
||||
is_external = prop && streq(prop, "external");
|
||||
udev_device_unref(udev_device);
|
||||
|
||||
return is_external;
|
||||
}
|
||||
|
||||
START_TEST(device_sendevents_config_touchpad)
|
||||
{
|
||||
struct litest_device *dev = litest_current_device();
|
||||
|
|
@ -71,7 +87,7 @@ START_TEST(device_sendevents_config_touchpad)
|
|||
|
||||
/* The wacom devices in the test suite are external */
|
||||
if (libevdev_get_id_vendor(dev->evdev) != VENDOR_ID_WACOM &&
|
||||
libevdev_get_id_bustype(dev->evdev) != BUS_BLUETOOTH)
|
||||
!touchpad_is_external(dev))
|
||||
expected |=
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
|
||||
|
||||
|
|
@ -91,7 +107,7 @@ START_TEST(device_sendevents_config_touchpad_superset)
|
|||
|
||||
/* The wacom devices in the test suite are external */
|
||||
if (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_WACOM ||
|
||||
libevdev_get_id_bustype(dev->evdev) == BUS_BLUETOOTH)
|
||||
touchpad_is_external(dev))
|
||||
return;
|
||||
|
||||
device = dev->libinput_device;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue