plugin: when disabling wheel-debouncing set to the correct enum value

This isn't a boolean. Let's change the first enum value to something
truthy so any use as boolean is more likely to trigger test failures.

Fixes: 18992b2ec0 ("plugin: allow disabling the wheel debouncing feature")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1300>
This commit is contained in:
Peter Hutterer 2025-08-18 12:24:35 +10:00
parent e45cd2bc13
commit 3ff1a2e24d

View file

@ -63,7 +63,7 @@ enum wheel_event {
}; };
enum ignore_strategy { enum ignore_strategy {
MAYBE, /* use heuristics but don't yet accumulate */ MAYBE = 1, /* use heuristics but don't yet accumulate */
PASSTHROUGH, /* do not accumulate, pass through */ PASSTHROUGH, /* do not accumulate, pass through */
ACCUMULATE, /* accumulate scroll wheel events */ ACCUMULATE, /* accumulate scroll wheel events */
ALWAYS_ACCUMULATE, /* always accumulate wheel events */ ALWAYS_ACCUMULATE, /* always accumulate wheel events */
@ -149,11 +149,12 @@ wheel_maybe_disable(struct plugin_device *device)
if (device->state != WHEEL_STATE_NONE) if (device->state != WHEEL_STATE_NONE)
return; return;
if (device->want_feature_disabled && device->ignore_small_hi_res_movements) { if (device->want_feature_disabled &&
device->ignore_small_hi_res_movements != PASSTHROUGH) {
plugin_log_debug(device->parent->plugin, plugin_log_debug(device->parent->plugin,
"%s: disabled wheel debouncing on request\n", "%s: disabled wheel debouncing on request\n",
libinput_device_get_name(device->device)); libinput_device_get_name(device->device));
device->ignore_small_hi_res_movements = false; device->ignore_small_hi_res_movements = PASSTHROUGH;
libinput_plugin_timer_cancel(device->scroll_timer); libinput_plugin_timer_cancel(device->scroll_timer);
device->scroll_timer = device->scroll_timer =
libinput_plugin_timer_unref(device->scroll_timer); libinput_plugin_timer_unref(device->scroll_timer);