set seat capability for touch

Daniel Barlow 2022-07-12 23:03:44 +00:00
parent 9b36e46674
commit 6cd5c3d245
2 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@ struct kiwmi_input {
struct wl_listener new_input;
struct kiwmi_cursor *cursor;
struct kiwmi_seat *seat;
int touchpads;
struct {
struct wl_signal keyboard_new;

View File

@ -32,6 +32,7 @@ static void
new_touch(struct kiwmi_input *input, struct wlr_input_device *device)
{
wlr_cursor_attach_input_device(input->cursor->cursor, device);
input->touchpads++;
}
static void
@ -74,6 +75,9 @@ new_input_notify(struct wl_listener *listener, void *data)
if (!wl_list_empty(&input->keyboards)) {
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
}
if(input->touchpads) {
caps |= WL_SEAT_CAPABILITY_TOUCH;
}
wlr_seat_set_capabilities(input->seat->seat, caps);
}