From 3ff1a2e24d1d2424a06e6b0ef4fa74aaa28f22f4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 18 Aug 2025 12:24:35 +1000 Subject: [PATCH] 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: 18992b2ec0de ("plugin: allow disabling the wheel debouncing feature") Part-of: --- src/libinput-plugin-mouse-wheel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libinput-plugin-mouse-wheel.c b/src/libinput-plugin-mouse-wheel.c index cc91a990..cade46a4 100644 --- a/src/libinput-plugin-mouse-wheel.c +++ b/src/libinput-plugin-mouse-wheel.c @@ -63,7 +63,7 @@ enum wheel_event { }; 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 */ ACCUMULATE, /* accumulate scroll 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) 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, "%s: disabled wheel debouncing on request\n", 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); device->scroll_timer = libinput_plugin_timer_unref(device->scroll_timer);