mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-03 07:17:06 -04: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
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue