mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-24 17:00:06 +01:00
touchpad: make the hysteresis dependent on physical distance
Some touchpads, e.g. the Cyapa in the Acer c720 have a small axis range ([0, 870], [0, 470]), so the diagonal/magic value yields a hysteresis margin of 1 device unit. On that device, that's one-tenth of a millimeter, causing pointer motion just by holding the finger. For touchpads that provide a physical resolution, set the hysteresis axes to 0.5mm and do away with the magic factor. https://bugzilla.redhat.com/show_bug.cgi?id=1230441 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
452df0e8d3
commit
f13fbc96e8
1 changed files with 12 additions and 4 deletions
|
|
@ -1492,10 +1492,18 @@ tp_init(struct tp_dispatch *tp,
|
|||
EV_ABS,
|
||||
ABS_MT_DISTANCE);
|
||||
|
||||
tp->hysteresis_margin.x =
|
||||
diagonal / DEFAULT_HYSTERESIS_MARGIN_DENOMINATOR;
|
||||
tp->hysteresis_margin.y =
|
||||
diagonal / DEFAULT_HYSTERESIS_MARGIN_DENOMINATOR;
|
||||
if (device->abs.fake_resolution) {
|
||||
tp->hysteresis_margin.x =
|
||||
diagonal / DEFAULT_HYSTERESIS_MARGIN_DENOMINATOR;
|
||||
tp->hysteresis_margin.y =
|
||||
diagonal / DEFAULT_HYSTERESIS_MARGIN_DENOMINATOR;
|
||||
} else {
|
||||
int res_x = tp->device->abs.absinfo_x->resolution,
|
||||
res_y = tp->device->abs.absinfo_y->resolution;
|
||||
|
||||
tp->hysteresis_margin.x = res_x/2;
|
||||
tp->hysteresis_margin.y = res_y/2;
|
||||
}
|
||||
|
||||
if (tp_init_accel(tp, diagonal) != 0)
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue