From: Peter Hutterer Date: Tue, 29 Oct 2024 10:17:00 +0000 (+1000) Subject: tablet: default to a built-in tablet X-Git-Tag: 1.27.0~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1e49c7b3d83f0d44f51a6e72895a0416a162cd7;p=platform%2Fupstream%2Flibinput.git tablet: default to a built-in tablet 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: --- diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index be91c9e6..5a458582 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -2594,10 +2594,10 @@ static inline bool 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 } diff --git a/test/test-tablet.c b/test/test-tablet.c index 07a14dc4..f33dc406 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -3683,10 +3683,14 @@ END_TEST 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) {