pointer: add a frame event

Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes https://github.com/swaywm/wlroots/issues/1468
This commit is contained in:
emersion 2019-01-26 11:04:05 +01:00
parent 209210d307
commit 5de26ad8ed
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
14 changed files with 96 additions and 21 deletions

View file

@ -67,16 +67,13 @@ static void registry_global(void *data, struct wl_registry *registry,
if (strcmp(iface, wl_compositor_interface.name) == 0) {
wl->compositor = wl_registry_bind(registry, name,
&wl_compositor_interface, 4);
} else if (strcmp(iface, wl_seat_interface.name) == 0) {
wl->seat = wl_registry_bind(registry, name,
&wl_seat_interface, 2);
&wl_seat_interface, 5);
wl_seat_add_listener(wl->seat, &seat_listener, wl);
} else if (strcmp(iface, wl_shm_interface.name) == 0) {
wl->shm = wl_registry_bind(registry, name,
&wl_shm_interface, 1);
} else if (strcmp(iface, xdg_wm_base_interface.name) == 0) {
wl->xdg_wm_base = wl_registry_bind(registry, name,
&xdg_wm_base_interface, 1);

View file

@ -126,7 +126,14 @@ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer,
}
static void pointer_handle_frame(void *data, struct wl_pointer *wl_pointer) {
// This space is intentionally left blank
struct wlr_wl_backend *backend = data;
struct wlr_wl_pointer *pointer = backend->current_pointer;
if (pointer == NULL) {
return;
}
wlr_signal_emit_safe(&pointer->wlr_pointer.events.frame,
&pointer->wlr_pointer);
}
static void pointer_handle_axis_source(void *data,