WIP: implement touch scrolling

This commit is contained in:
Hugo Osvaldo Barrera 2023-04-19 12:03:19 +02:00
parent a2db3cdd5b
commit 6f0327eb43
4 changed files with 122 additions and 3 deletions

View file

@ -270,9 +270,10 @@ seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
struct seat *seat = data;
xassert(seat->wl_seat == wl_seat);
LOG_DBG("%s: keyboard=%s, pointer=%s", seat->name,
LOG_DBG("%s: keyboard=%s, pointer=%s, touch=%s", seat->name,
(caps & WL_SEAT_CAPABILITY_KEYBOARD) ? "yes" : "no",
(caps & WL_SEAT_CAPABILITY_POINTER) ? "yes" : "no");
(caps & WL_SEAT_CAPABILITY_POINTER) ? "yes" : "no",
(caps & WL_SEAT_CAPABILITY_TOUCH) ? "yes" : "no");
if (caps & WL_SEAT_CAPABILITY_KEYBOARD) {
if (seat->wl_keyboard == NULL) {
@ -313,6 +314,18 @@ seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
seat->pointer.cursor = NULL;
}
}
if (caps & WL_SEAT_CAPABILITY_TOUCH) {
if (seat->wl_touch == NULL) {
seat->wl_touch = wl_seat_get_touch(wl_seat);
wl_touch_add_listener(seat->wl_touch, &touch_listener, seat);
}
} else {
if (seat->wl_touch != NULL) {
wl_touch_release(seat->wl_touch);
seat->wl_touch = NULL;
}
}
}
static void