Created
January 15, 2025 05:36
-
-
Save waldolemmer/b4c9e449ae96c86f67d7ca6548b7b50f to your computer and use it in GitHub Desktop.
Disable edge palm detection on Linux (Wayland with libinput)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff '--color=auto' -ru a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c | |
--- a/src/evdev-mt-touchpad.c 2024-11-19 05:41:39.000000000 +0200 | |
+++ b/src/evdev-mt-touchpad.c 2025-01-15 07:22:32.516557264 +0200 | |
@@ -3354,40 +3354,7 @@ | |
tp_init_palmdetect_edge(struct tp_dispatch *tp, | |
struct evdev_device *device) | |
{ | |
- double width, height; | |
- struct phys_coords mm = { 0.0, 0.0 }; | |
- struct device_coords edges; | |
- | |
- if (device->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD && | |
- !tp_is_tpkb_combo_below(device)) | |
- return; | |
- | |
- /* Edge palm detection hurts more than it helps on Apple touchpads. */ | |
- if (evdev_device_has_model_quirk(device, QUIRK_MODEL_APPLE_TOUCHPAD)) | |
- return; | |
- | |
- evdev_device_get_size(device, &width, &height); | |
- | |
- /* Enable edge palm detection on touchpads >= 70 mm. Anything | |
- smaller probably won't need it, until we find out it does */ | |
- if (width < 70.0) | |
- return; | |
- | |
- /* palm edges are 8% of the width on each side */ | |
- mm.x = min(8, width * 0.08); | |
- edges = evdev_device_mm_to_units(device, &mm); | |
- tp->palm.left_edge = edges.x; | |
- | |
- mm.x = width - min(8, width * 0.08); | |
- edges = evdev_device_mm_to_units(device, &mm); | |
- tp->palm.right_edge = edges.x; | |
- | |
- if (!tp->buttons.has_topbuttons && height > 55) { | |
- /* top edge is 5% of the height */ | |
- mm.y = height * 0.05; | |
- edges = evdev_device_mm_to_units(device, &mm); | |
- tp->palm.upper_edge = edges.y; | |
- } | |
+ // Do not perform edge palm detection | |
} | |
static int |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a patch to libinput that attempts to disable the deadzone near the edges of the touchpad.