backend/wayland: handle high-res scroll events

Receive high-resolution scroll events from the parent compositor using
a Wayland listiner and emit the appropiate wlr_pointer signal.
This commit is contained in:
José Expósito 2022-02-25 17:31:01 +01:00
parent e00f042f80
commit 11f49b6b6a
2 changed files with 20 additions and 1 deletions

View file

@ -346,8 +346,15 @@ static void registry_global(void *data, struct wl_registry *registry,
wl->compositor = wl_registry_bind(registry, name,
&wl_compositor_interface, 4);
} else if (strcmp(iface, wl_seat_interface.name) == 0) {
uint32_t target_version = version;
if (version < 5) {
target_version = 5;
}
if (version > 8) {
target_version = 8;
}
struct wl_seat *wl_seat = wl_registry_bind(registry, name,
&wl_seat_interface, 5);
&wl_seat_interface, target_version);
if (!create_wl_seat(wl_seat, wl)) {
wl_seat_destroy(wl_seat);
}