The vast majority of devices that libwacom doesn't know about are the
various built-in ones. Since the only effect in our code here is that we
enable the calibration matrix, let's default to built-in if we don't
know any better - better to have the matrix and not use it than to not
be able to calibrate a tablet.
Note that libwacom 2.11 and later also now default to a built-in tablet.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1074>
tablet_is_display_tablet(WacomDevice *wacom)
{
#if HAVE_LIBWACOM
- return wacom &&
- !!(libwacom_get_integration_flags(wacom) & (WACOM_DEVICE_INTEGRATED_SYSTEM|WACOM_DEVICE_INTEGRATED_DISPLAY));
+ return !wacom ||
+ (libwacom_get_integration_flags(wacom) & (WACOM_DEVICE_INTEGRATED_SYSTEM|WACOM_DEVICE_INTEGRATED_DISPLAY));
#else
- return false;
+ return true;
#endif
}
static bool
device_has_calibration(struct litest_device *dev)
{
- bool has_calibration = libevdev_has_property(dev->evdev, INPUT_PROP_DIRECT);
- if (has_calibration)
+ if (libevdev_has_property(dev->evdev, INPUT_PROP_DIRECT))
return true;
+
+ bool has_calibration =
+ libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_PEN) ||
+ libevdev_has_event_code(dev->evdev, EV_KEY, BTN_STYLUS);
+
#if HAVE_LIBWACOM
WacomDeviceDatabase *db = libwacom_database_new();
if (db) {