seat: Assume there is always a keyboard device

This makes it so that users first keystroke doesn't get 'eaten'
This makes cage easier to use, especially when foot is the only client
This commit is contained in:
nerdopolis 2024-04-26 21:55:38 -04:00
parent e7d8780f46
commit b675c2e568

7
seat.c
View file

@ -113,11 +113,8 @@ press_cursor_button(struct cg_seat *seat, struct wlr_input_device *device, uint3
static void
update_capabilities(struct cg_seat *seat)
{
uint32_t caps = 0;
uint32_t caps = WL_SEAT_CAPABILITY_KEYBOARD;
if (!wl_list_empty(&seat->keyboard_groups)) {
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
}
if (!wl_list_empty(&seat->pointers)) {
caps |= WL_SEAT_CAPABILITY_POINTER;
}
@ -880,6 +877,8 @@ seat_create(struct cg_server *server, struct wlr_backend *backend)
seat->start_drag.notify = handle_start_drag;
wl_signal_add(&seat->seat->events.start_drag, &seat->start_drag);
update_capabilities(seat);
return seat;
}