diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 2904fbbc..851d49da 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -107,7 +107,7 @@ static void tablet_process_absolute(struct tablet_dispatch *tablet, struct evdev_device *device, struct input_event *e, - uint32_t time) + uint64_t time) { enum libinput_tablet_axis axis; @@ -316,7 +316,7 @@ get_delta(enum libinput_tablet_axis axis, double current, double old) static void tablet_check_notify_axes(struct tablet_dispatch *tablet, struct evdev_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool) { struct libinput_device *base = &device->base; @@ -478,7 +478,7 @@ static void tablet_process_key(struct tablet_dispatch *tablet, struct evdev_device *device, struct input_event *e, - uint32_t time) + uint64_t time) { switch (e->code) { case BTN_TOOL_PEN: @@ -521,7 +521,7 @@ static void tablet_process_relative(struct tablet_dispatch *tablet, struct evdev_device *device, struct input_event *e, - uint32_t time) + uint64_t time) { enum libinput_tablet_axis axis; @@ -551,7 +551,7 @@ static void tablet_process_misc(struct tablet_dispatch *tablet, struct evdev_device *device, struct input_event *e, - uint32_t time) + uint64_t time) { switch (e->code) { case MSC_SERIAL: @@ -779,7 +779,7 @@ tablet_get_tool(struct tablet_dispatch *tablet, static void tablet_notify_button_mask(struct tablet_dispatch *tablet, struct evdev_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, const unsigned char *buttons, unsigned int buttons_len, @@ -805,7 +805,7 @@ tablet_notify_button_mask(struct tablet_dispatch *tablet, static void tablet_notify_buttons(struct tablet_dispatch *tablet, struct evdev_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, enum libinput_button_state state) { @@ -864,7 +864,7 @@ sanitize_tablet_axes(struct tablet_dispatch *tablet) static void tablet_flush(struct tablet_dispatch *tablet, struct evdev_device *device, - uint32_t time) + uint64_t time) { struct libinput_tool *tool = tablet_get_tool(tablet, diff --git a/src/libinput-private.h b/src/libinput-private.h index 69ed26e3..d9ba7d29 100644 --- a/src/libinput-private.h +++ b/src/libinput-private.h @@ -432,7 +432,7 @@ touch_notify_frame(struct libinput_device *device, void tablet_notify_axis(struct libinput_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, unsigned char *changed_axes, double *axes, @@ -441,7 +441,7 @@ tablet_notify_axis(struct libinput_device *device, void tablet_notify_proximity(struct libinput_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, enum libinput_tool_proximity_state state, unsigned char *changed_axes, @@ -449,7 +449,7 @@ tablet_notify_proximity(struct libinput_device *device, void tablet_notify_button(struct libinput_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, double *axes, int32_t button, diff --git a/src/libinput.c b/src/libinput.c index 3557b8fd..46578fe9 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -130,7 +130,7 @@ struct libinput_event_tablet { uint32_t button; enum libinput_button_state state; uint32_t seat_button_count; - uint32_t time; + uint64_t time; double axes[LIBINPUT_TABLET_AXIS_MAX + 1]; double deltas[LIBINPUT_TABLET_AXIS_MAX + 1]; double deltas_discrete[LIBINPUT_TABLET_AXIS_MAX + 1]; @@ -1021,6 +1021,12 @@ libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event) LIBINPUT_EXPORT uint32_t libinput_event_tablet_get_time(struct libinput_event_tablet *event) +{ + return us2ms(event->time); +} + +LIBINPUT_EXPORT uint64_t +libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event) { return event->time; } @@ -1841,7 +1847,7 @@ touch_notify_frame(struct libinput_device *device, void tablet_notify_axis(struct libinput_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, unsigned char *changed_axes, double *axes, @@ -1876,7 +1882,7 @@ tablet_notify_axis(struct libinput_device *device, void tablet_notify_proximity(struct libinput_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, enum libinput_tool_proximity_state proximity_state, unsigned char *changed_axes, @@ -1910,7 +1916,7 @@ tablet_notify_proximity(struct libinput_device *device, void tablet_notify_button(struct libinput_device *device, - uint32_t time, + uint64_t time, struct libinput_tool *tool, double *axes, int32_t button, diff --git a/src/libinput.h b/src/libinput.h index 212ee351..d9834557 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -1541,6 +1541,15 @@ libinput_event_tablet_get_seat_button_count(struct libinput_event_tablet *event) uint32_t libinput_event_tablet_get_time(struct libinput_event_tablet *event); +/** + * @ingroup event_tablet + * + * @param event The libinput tablet event + * @return The event time for this event in microseconds + */ +uint64_t +libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event); + /** * @ingroup event_tablet * diff --git a/src/libinput.sym b/src/libinput.sym index 15295474..84800241 100644 --- a/src/libinput.sym +++ b/src/libinput.sym @@ -191,6 +191,7 @@ LIBINPUT_TABLET_SUPPORT { libinput_event_tablet_get_tool; libinput_event_tablet_get_x_transformed; libinput_event_tablet_get_y_transformed; + libinput_event_tablet_get_time_usec; libinput_tool_get_serial; libinput_tool_get_tool_id; libinput_tool_get_type;