touchpad: allow disabling palm detection altogether

Also a long-requested configuration option but it's difficult to expose
- depending on the touchpad we utilize different palm detection methods
and in theory may add to those at any time as we see fit.

Disabling it completely via a configuration option is only going to get
us more bug reports because *some* palm detection is likely desired on
most setups. So let's allow disabling it in a plugin and thus leave any
further palm detection code up to the plugin.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
This commit is contained in:
Peter Hutterer 2025-06-26 14:40:25 +10:00
parent afd3be9a99
commit 5b2a723a02
2 changed files with 9 additions and 0 deletions

View file

@ -2768,6 +2768,14 @@ tp_interface_disable_feature(struct evdev_dispatch *dispatch,
case LIBINPUT_FEATURE_TOUCHPAD_HYSTERESIS:
tp->hysteresis.enabled = false;
break;
case LIBINPUT_FEATURE_TOUCHPAD_PALM_DETECTION:
tp->palm.use_mt_tool = false;
tp->palm.use_pressure = false;
tp->palm.use_size = false;
tp->palm.right_edge = INT_MAX;
tp->palm.left_edge = INT_MIN;
tp->palm.upper_edge = INT_MIN;
break;
default:
return;
}

View file

@ -28,6 +28,7 @@ enum libinput_feature {
LIBINPUT_FEATURE_WHEEL_DEBOUNCING,
LIBINPUT_FEATURE_TOUCHPAD_JUMP_DETECTION,
LIBINPUT_FEATURE_TOUCHPAD_HYSTERESIS,
LIBINPUT_FEATURE_TOUCHPAD_PALM_DETECTION,
_LIBINPUT_N_FEATURES
};