From 6524edd9de6ade6c985be1755231d1bbdec07caf Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 26 Aug 2025 07:39:11 +1000 Subject: [PATCH] plugin: don't initialize the debounce plugin on a virtual device Effectively the same motivation as commit 5d23794d5361 ("tablet: disable smoothing for uinput devices") - virtual devices should not need debouncing and if they do let's do the debouncing on the other end that creates those devices. (cherry picked from commit 428a3299a895d1313c6dff94b21474b6bea78516) Part-of: --- src/libinput-plugin-button-debounce.c | 4 ++++ src/libinput-private.h | 3 +++ src/libinput.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/libinput-plugin-button-debounce.c b/src/libinput-plugin-button-debounce.c index aff1752e..8fc34294 100644 --- a/src/libinput-plugin-button-debounce.c +++ b/src/libinput-plugin-button-debounce.c @@ -33,6 +33,7 @@ #include "libinput-log.h" #include "libinput-plugin-button-debounce.h" #include "libinput-plugin.h" +#include "libinput-private.h" #include "libinput-util.h" #include "quirks.h" #include "timer.h" @@ -730,6 +731,9 @@ debounce_plugin_device_added(struct libinput_plugin *libinput_plugin, if (!libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) return; + if (libinput_device_is_virtual(device)) + return; + _unref_(udev_device) *udev_device = libinput_device_get_udev_device(device); if (udev_device) { const char *prop = udev_device_get_property_value(udev_device, diff --git a/src/libinput-private.h b/src/libinput-private.h index 30ee5650..46110c6a 100644 --- a/src/libinput-private.h +++ b/src/libinput-private.h @@ -724,6 +724,9 @@ libinput_device_init(struct libinput_device *device, struct libinput_seat *seat) bool libinput_device_has_model_quirk(struct libinput_device *device, enum quirk model_quirk); +bool +libinput_device_is_virtual(struct libinput_device *device); + struct libinput_device_group * libinput_device_group_create(struct libinput *libinput, const char *identifier); diff --git a/src/libinput.c b/src/libinput.c index 949780e8..cd4ea825 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -2244,6 +2244,12 @@ libinput_device_has_model_quirk(struct libinput_device *device, enum quirk model return result; } +bool +libinput_device_is_virtual(struct libinput_device *device) +{ + return evdev_device_is_virtual((struct evdev_device *)device); +} + static uint32_t update_seat_key_count(struct libinput_seat *seat, keycode_t keycode,