From 49b58311590402af346fef176785f9de9b250e44 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 29 Oct 2018 13:42:19 +1000 Subject: evdev: log the wheel click angle setting Log if we use a non-default click angle setting, makes it easier to debug this. The condition to add the log was a bit unwieldly to read, so this also factors out the property names to temporary variables. Signed-off-by: Peter Hutterer --- src/evdev.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 25bb6e2e..b2b831f2 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1144,21 +1144,23 @@ static inline struct wheel_angle evdev_read_wheel_click_props(struct evdev_device *device) { struct wheel_angle angles; + const char *wheel_count = "MOUSE_WHEEL_CLICK_COUNT"; + const char *wheel_angle = "MOUSE_WHEEL_CLICK_ANGLE"; + const char *hwheel_count = "MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL"; + const char *hwheel_angle = "MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL"; /* CLICK_COUNT overrides CLICK_ANGLE */ - if (!evdev_read_wheel_click_count_prop(device, - "MOUSE_WHEEL_CLICK_COUNT", - &angles.y)) - evdev_read_wheel_click_prop(device, - "MOUSE_WHEEL_CLICK_ANGLE", - &angles.y); - if (!evdev_read_wheel_click_count_prop(device, - "MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL", - &angles.x)) { - if (!evdev_read_wheel_click_prop(device, - "MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL", - &angles.x)) - angles.x = angles.y; + if (evdev_read_wheel_click_count_prop(device, wheel_count, &angles.y) || + evdev_read_wheel_click_prop(device, wheel_angle, &angles.y)) { + evdev_log_debug(device, + "wheel: vert click angle: %.2f\n", angles.y); + } + if (evdev_read_wheel_click_count_prop(device, hwheel_count, &angles.x) || + evdev_read_wheel_click_prop(device, hwheel_angle, &angles.x)) { + evdev_log_debug(device, + "wheel: horizontal click angle: %.2f\n", angles.y); + } else { + angles.x = angles.y; } return angles; -- cgit v1.2.1