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:
random human 2019-06-14 22:24:03 +00:00
parent 79ed410be4
commit e617da0378
No known key found for this signature in database
GPG key ID: 73E5A60444CC77A3
9 changed files with 172 additions and 38 deletions

View file

@ -16,6 +16,7 @@
#include "backend/wayland.h"
#include "util/signal.h"
#include "input-timestamps-unstable-v1-client-protocol.h"
#include "xdg-decoration-unstable-v1-client-protocol.h"
#include "pointer-gestures-unstable-v1-client-protocol.h"
#include "xdg-shell-client-protocol.h"
@ -81,6 +82,9 @@ static void registry_global(void *data, struct wl_registry *registry,
} else if (strcmp(iface, zwp_pointer_gestures_v1_interface.name) == 0) {
wl->zwp_pointer_gestures_v1 = wl_registry_bind(registry, name,
&zwp_pointer_gestures_v1_interface, 1);
} else if (strcmp(iface, zwp_input_timestamps_manager_v1_interface.name) == 0) {
wl->input_timestamps.manager = wl_registry_bind(registry, name,
&zwp_input_timestamps_manager_v1_interface, 1);
}
}
@ -227,6 +231,11 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
goto error_registry;
}
if (!wl->input_timestamps.manager) {
wlr_log(WLR_INFO,
"Remote Wayland compositor does not support input-timestamps");
}
struct wl_event_loop *loop = wl_display_get_event_loop(wl->local_display);
int fd = wl_display_get_fd(wl->remote_display);
int events = WL_EVENT_READABLE | WL_EVENT_ERROR | WL_EVENT_HANGUP;