touchpad: allow disabling the touchpad jumping cursor detection

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
This commit is contained in:
Peter Hutterer 2025-06-26 14:18:07 +10:00
parent 18992b2ec0
commit 2bb9c66cd7
2 changed files with 18 additions and 0 deletions

View file

@ -35,6 +35,7 @@
#include "util-input-event.h"
#include "evdev-mt-touchpad.h"
#include "libinput-feature.h"
#include "quirks.h"
#define DEFAULT_TRACKPOINT_ACTIVITY_TIMEOUT ms2us(300)
@ -2754,6 +2755,21 @@ tp_interface_left_handed_toggled(struct evdev_dispatch *dispatch,
tp_change_rotation(device, DONT_NOTIFY);
}
static void
tp_interface_disable_feature(struct evdev_dispatch *dispatch,
enum libinput_feature feature)
{
struct tp_dispatch *tp = tp_dispatch(dispatch);
switch (feature) {
case LIBINPUT_FEATURE_TOUCHPAD_JUMP_DETECTION:
tp->jump.detection_disabled = true;
break;
default:
return;
}
}
static struct evdev_dispatch_interface tp_interface = {
.process = tp_interface_process,
.suspend = tp_interface_suspend,
@ -2768,6 +2784,7 @@ static struct evdev_dispatch_interface tp_interface = {
.touch_arbitration_update_rect = NULL,
.get_switch_state = NULL,
.left_handed_toggle = tp_interface_left_handed_toggled,
.disable_feature = tp_interface_disable_feature,
};
static void

View file

@ -26,6 +26,7 @@
enum libinput_feature {
LIBINPUT_FEATURE_BUTTON_DEBOUNCING = 1,
LIBINPUT_FEATURE_WHEEL_DEBOUNCING,
LIBINPUT_FEATURE_TOUCHPAD_JUMP_DETECTION,
_LIBINPUT_N_FEATURES
};