From edc25c071a4aead5d62fc5ac5e358171f5afd107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chojnowski?= Date: Mon, 2 Feb 2026 08:06:39 +0100 Subject: [PATCH] tablet: fix handling of AttrPressureRange quirk tablet_get_quirked_pressure_thresholds() is wrong: the pressure thresholds for tip press and tip release are swapped around. This seems to be a regression introduced in commit 4bc27543e907. This prevents AttrPressureRange from working as intended for tablets, and causes weird things to happen if it's set. (For example, when pressure is in the range between the intended release threshold and the intended press threshold, the "pressed" status flip-flops between 0 and 1 every frame). Fix that. (cherry picked from commit b58d5a165b62354b48efca5605150c86e4c1e0c2) Part-of: --- src/evdev-tablet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 3a5a8393..129324b0 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -1142,8 +1142,8 @@ tablet_get_quirked_pressure_thresholds(struct tablet_dispatch *tablet, int *hi, _unref_(quirks) *q = libinput_device_get_quirks(&device->base); if (q && quirks_get_range(q, QUIRK_ATTR_PRESSURE_RANGE, &r)) { if (r.lower < r.upper) { - *hi = r.lower; - *lo = r.upper; + *lo = r.lower; + *hi = r.upper; status = true; } else { evdev_log_info(device,