mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-07-10 00:06:37 -04:00
WIP: implement touch scrolling
This commit is contained in:
parent
a2db3cdd5b
commit
6f0327eb43
4 changed files with 122 additions and 3 deletions
17
wayland.c
17
wayland.c
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue