mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 17:20:04 +01:00
tablet: reject tablets without resolution
Fix the kernel driver or get a udev override in place. Tablets not having a physical size is not ok. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
d308022fb3
commit
dbeb2f7916
2 changed files with 15 additions and 0 deletions
|
|
@ -1712,6 +1712,7 @@ tablet_reject_device(struct evdev_device *device)
|
|||
{
|
||||
struct libevdev *evdev = device->evdev;
|
||||
int rc = -1;
|
||||
double w, h;
|
||||
|
||||
if (!libevdev_has_event_code(evdev, EV_ABS, ABS_X) ||
|
||||
!libevdev_has_event_code(evdev, EV_ABS, ABS_Y))
|
||||
|
|
@ -1720,6 +1721,9 @@ tablet_reject_device(struct evdev_device *device)
|
|||
if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN))
|
||||
goto out;
|
||||
|
||||
if (evdev_device_get_size(device, &w, &h) != 0)
|
||||
goto out;
|
||||
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
|
|
|||
|
|
@ -227,6 +227,16 @@ static int events[] = {
|
|||
-1, -1,
|
||||
};
|
||||
|
||||
static const char udev_rule[] =
|
||||
"ACTION==\"remove\", GOTO=\"waltop_end\"\n"
|
||||
"KERNEL!=\"event*\", GOTO=\"waltop_end\"\n"
|
||||
"ENV{ID_INPUT_TABLET}==\"\", GOTO=\"waltop_end\"\n"
|
||||
"\n"
|
||||
"ATTRS{name}==\"litest WALTOP Batteryless Tablet*\",\\\n"
|
||||
" ENV{LIBINPUT_ATTR_SIZE_HINT}=\"200x200\",\n"
|
||||
"\n"
|
||||
"LABEL=\"touchpad_end\"";
|
||||
|
||||
struct litest_test_device litest_waltop_tablet_device = {
|
||||
.type = LITEST_WALTOP,
|
||||
.features = LITEST_TABLET | LITEST_WHEEL | LITEST_TILT,
|
||||
|
|
@ -238,4 +248,5 @@ struct litest_test_device litest_waltop_tablet_device = {
|
|||
.id = &input_id,
|
||||
.events = events,
|
||||
.absinfo = absinfo,
|
||||
.udev_rule = udev_rule,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue