diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index a683d9a4..872da989 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1628,8 +1628,9 @@ tp_init_scroll(struct tp_dispatch *tp, struct evdev_device *device) tp->scroll.method = tp_scroll_get_default_method(tp); tp->device->base.config.scroll_method = &tp->scroll.config_method; - /* In mm for touchpads with valid resolution, see tp_init_accel() */ - tp->device->scroll.threshold = 5.0; + /* In mm for touchpads with valid resolution, see tp_init_accel() */ + tp->device->scroll.threshold = 0.0; + tp->device->scroll.direction_lock_threshold = 5.0; return 0; } diff --git a/src/evdev.c b/src/evdev.c index 17c26043..53ebf9dc 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2146,6 +2146,7 @@ evdev_device_create(struct libinput_seat *seat, device->pending_event = EVDEV_NONE; device->devname = libevdev_get_name(device->evdev); device->scroll.threshold = 5.0; /* Default may be overridden */ + device->scroll.direction_lock_threshold = 5.0; /* Default may be overridden */ device->scroll.direction = 0; device->scroll.wheel_click_angle = evdev_read_wheel_click_prop(device); @@ -2414,12 +2415,12 @@ evdev_post_scroll(struct evdev_device *device, trigger speed to start scrolling in the other direction */ } else if (!evdev_is_scrolling(device, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL)) { - if (fabs(delta->y) >= device->scroll.threshold) + if (fabs(delta->y) >= device->scroll.direction_lock_threshold) evdev_start_scrolling(device, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); } else if (!evdev_is_scrolling(device, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL)) { - if (fabs(delta->x) >= device->scroll.threshold) + if (fabs(delta->x) >= device->scroll.direction_lock_threshold) evdev_start_scrolling(device, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL); } diff --git a/src/evdev.h b/src/evdev.h index be5df0d0..65c5a41a 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -166,6 +166,7 @@ struct evdev_device { void (*change_scroll_method)(struct evdev_device *device); bool button_scroll_active; double threshold; + double direction_lock_threshold; uint32_t direction; struct normalized_coords buildup;