summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad-buttons.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-07-03 11:28:18 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-07-10 12:00:50 +1000
commit756c7e3dace0f59ec1c31ab425f95734ad245bc8 (patch)
tree57e5fe7c65970874d98830b1ef71d4f9aa96333e /src/evdev-mt-touchpad-buttons.c
parent9e0da73bbfe9fc9a1d3a7a733edaff988125a6c6 (diff)
downloadlibinput-756c7e3dace0f59ec1c31ab425f95734ad245bc8.tar.gz
timer: add a timer name to each timer
So we have something useful to print when we trigger an error in the timer code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-mt-touchpad-buttons.c')
-rw-r--r--src/evdev-mt-touchpad-buttons.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 83a38c2b..358b9ea4 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -835,6 +835,7 @@ tp_init_buttons(struct tp_dispatch *tp,
{
struct tp_touch *t;
const struct input_absinfo *absinfo_x, *absinfo_y;
+ int i;
tp->buttons.is_clickpad = libevdev_has_property(device->evdev,
INPUT_PROP_BUTTONPAD);
@@ -873,10 +874,20 @@ tp_init_buttons(struct tp_dispatch *tp,
tp_init_middlebutton_emulation(tp, device);
+ i = 0;
tp_for_each_touch(tp, t) {
+ char timer_name[64];
+ i++;
+
+ snprintf(timer_name,
+ sizeof(timer_name),
+ "%s (%d) button",
+ evdev_device_get_sysname(device),
+ i);
t->button.state = BUTTON_STATE_NONE;
libinput_timer_init(&t->button.timer,
tp_libinput_context(tp),
+ timer_name,
tp_button_handle_timeout, t);
}
}
@@ -886,8 +897,10 @@ tp_remove_buttons(struct tp_dispatch *tp)
{
struct tp_touch *t;
- tp_for_each_touch(tp, t)
+ tp_for_each_touch(tp, t) {
libinput_timer_cancel(&t->button.timer);
+ libinput_timer_destroy(&t->button.timer);
+ }
}
static int