mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-01 01:40:35 -05:00
backend, virtual_keyboard: set the time_nsec field of relevant events
Backends modified: libinput (with microsecond precision), X11 (with millisecond precision), RDP (with millisecond precision), and Wayland (with nanosecond precision if the host server supports the input-timestamps protocol, otherwise millisecond precision); and virtual-keyboard protocol (with millisecond precision).
This commit is contained in:
parent
79ed410be4
commit
e617da0378
9 changed files with 172 additions and 38 deletions
|
|
@ -32,8 +32,9 @@ void handle_touch_down(struct libinput_event *event,
|
|||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_down wlr_event = { 0 };
|
||||
wlr_event.device = wlr_dev;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
uint64_t event_time = libinput_event_touch_get_time_usec(tevent);
|
||||
wlr_event.time_msec = usec_to_msec(event_time);
|
||||
wlr_event.time_nsec = event_time * 1000;
|
||||
wlr_event.touch_id = libinput_event_touch_get_slot(tevent);
|
||||
wlr_event.x = libinput_event_touch_get_x_transformed(tevent, 1);
|
||||
wlr_event.y = libinput_event_touch_get_y_transformed(tevent, 1);
|
||||
|
|
@ -52,8 +53,9 @@ void handle_touch_up(struct libinput_event *event,
|
|||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_up wlr_event = { 0 };
|
||||
wlr_event.device = wlr_dev;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
uint64_t event_time = libinput_event_touch_get_time_usec(tevent);
|
||||
wlr_event.time_msec = usec_to_msec(event_time);
|
||||
wlr_event.time_nsec = event_time * 1000;
|
||||
wlr_event.touch_id = libinput_event_touch_get_slot(tevent);
|
||||
wlr_signal_emit_safe(&wlr_dev->touch->events.up, &wlr_event);
|
||||
}
|
||||
|
|
@ -70,8 +72,9 @@ void handle_touch_motion(struct libinput_event *event,
|
|||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_motion wlr_event = { 0 };
|
||||
wlr_event.device = wlr_dev;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
uint64_t event_time = libinput_event_touch_get_time_usec(tevent);
|
||||
wlr_event.time_msec = usec_to_msec(event_time);
|
||||
wlr_event.time_nsec = event_time * 1000;
|
||||
wlr_event.touch_id = libinput_event_touch_get_slot(tevent);
|
||||
wlr_event.x = libinput_event_touch_get_x_transformed(tevent, 1);
|
||||
wlr_event.y = libinput_event_touch_get_y_transformed(tevent, 1);
|
||||
|
|
@ -90,8 +93,9 @@ void handle_touch_cancel(struct libinput_event *event,
|
|||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_cancel wlr_event = { 0 };
|
||||
wlr_event.device = wlr_dev;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
uint64_t event_time = libinput_event_touch_get_time_usec(tevent);
|
||||
wlr_event.time_msec = usec_to_msec(event_time);
|
||||
wlr_event.time_nsec = event_time * 1000;
|
||||
wlr_event.touch_id = libinput_event_touch_get_slot(tevent);
|
||||
wlr_signal_emit_safe(&wlr_dev->touch->events.cancel, &wlr_event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue