input: Add TL_POINTs for kernel timestamps

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2026-04-23 11:38:23 +03:00
parent 3f727bf1b5
commit c0d7bcd39a

View file

@ -44,6 +44,7 @@
#include "libinput-device.h"
#include "shared/helpers.h"
#include "shared/timespec-util.h"
#include "timeline.h"
#include "tablet-unstable-v2-server-protocol.h"
@ -111,6 +112,8 @@ handle_keyboard_key(struct libinput_device *libinput_device,
timespec_from_usec(&time, libinput_event_keyboard_get_time_usec(keyboard_event));
weston_input_event_init(&key_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&key_event.base_event), TLP_END);
weston_key_event_init(&key_event, key, key_state, STATE_UPDATE_AUTOMATIC);
notify_key(device->seat, &key_event);
@ -141,6 +144,8 @@ handle_pointer_motion(struct libinput_device *libinput_device,
weston_input_event_init(&event.base_event, &time, device->seat);
weston_pointer_motion_event_init(&event, WESTON_POINTER_MOTION_REL |
WESTON_POINTER_MOTION_REL_UNACCEL, NULL, &rel, &rel_unaccel);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
notify_motion(device->seat, &event);
return true;
@ -176,6 +181,8 @@ handle_pointer_motion_absolute(
height);
pos = weston_coord_global_from_output_point(x, y, output);
weston_input_event_init(&event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
weston_pointer_motion_event_init(&event, WESTON_POINTER_MOTION_ABS,
&pos, NULL, NULL);
notify_motion(device->seat, &event);
@ -209,6 +216,8 @@ handle_pointer_button(struct libinput_device *libinput_device,
libinput_event_pointer_get_time_usec(pointer_event));
weston_input_event_init(&button_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&button_event.base_event), TLP_END);
weston_pointer_button_event_init(&button_event,
libinput_event_pointer_get_button(pointer_event),
button_state);
@ -316,6 +325,8 @@ handle_pointer_axis(struct libinput_device *libinput_device,
vert = normalize_scroll(pointer_event, axis);
weston_input_event_init(&weston_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&weston_event.base_event), TLP_END);
weston_pointer_axis_event_init(&weston_event, WL_POINTER_AXIS_VERTICAL_SCROLL,
vert, (vert_discrete != 0), vert_discrete);
notify_axis(device->seat, &weston_event);
@ -327,6 +338,8 @@ handle_pointer_axis(struct libinput_device *libinput_device,
horiz = normalize_scroll(pointer_event, axis);
weston_input_event_init(&weston_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&weston_event.base_event), TLP_END);
weston_pointer_axis_event_init(&weston_event, WL_POINTER_AXIS_HORIZONTAL_SCROLL,
horiz, (horiz_discrete != 0), horiz_discrete);
notify_axis(device->seat, &weston_event);
@ -482,6 +495,9 @@ handle_touch_with_coords(struct libinput_device *libinput_device,
weston_input_event_init(&event.base_event, &time, seat);
weston_touch_event_init(&event, touch_type, touch_id, &pos);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
if (weston_touch_device_can_calibrate(device->touch_device)) {
norm.x = libinput_event_touch_get_x_transformed(touch_event, 1);
norm.y = libinput_event_touch_get_y_transformed(touch_event, 1);
@ -525,6 +541,8 @@ handle_touch_up(struct libinput_device *libinput_device,
weston_input_event_init(&event.base_event, &time, seat);
weston_touch_event_init(&event, WL_TOUCH_UP,
libinput_event_touch_get_seat_slot(touch_event), NULL);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
notify_touch(device->touch_device, &event);
}