seat: Call configure_libinput() for keyboards

Call configure_libinput() for keyboards in new_keyboard() and
seat_reconfigure().

This allows the use of the sendEventsMode configuration option on
keyboards in order to disable keyboard input, for example:

    <libinput>
        <device category="  RPI Wired Keyboard 1">
            <sendEventsMode>no</sendEventsMode>
        </device>
    </libinput>
This commit is contained in:
David Turner 2025-11-12 16:48:48 +00:00 committed by Consolatis
parent 366cf3c995
commit d15152b27b

View file

@ -128,6 +128,7 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
return; return;
} }
struct input *input = wlr_input_device->data; struct input *input = wlr_input_device->data;
assert(input); /* Check the caller remembered to set this! */
/* Set scroll factor to 1.0 for Wayland/X11 backends or virtual pointers */ /* Set scroll factor to 1.0 for Wayland/X11 backends or virtual pointers */
if (!wlr_input_device_is_libinput(wlr_input_device)) { if (!wlr_input_device_is_libinput(wlr_input_device)) {
@ -405,6 +406,9 @@ new_keyboard(struct seat *seat, struct wlr_input_device *device, bool is_virtual
keyboard->base.wlr_input_device = device; keyboard->base.wlr_input_device = device;
keyboard->wlr_keyboard = kb; keyboard->wlr_keyboard = kb;
keyboard->is_virtual = is_virtual; keyboard->is_virtual = is_virtual;
device->data = keyboard;
configure_libinput(device);
if (!seat->keyboard_group->keyboard.keymap) { if (!seat->keyboard_group->keyboard.keymap) {
wlr_log(WLR_ERROR, "cannot set keymap"); wlr_log(WLR_ERROR, "cannot set keymap");
@ -735,6 +739,7 @@ seat_reconfigure(struct server *server)
wl_list_for_each(input, &seat->inputs, link) { wl_list_for_each(input, &seat->inputs, link) {
switch (input->wlr_input_device->type) { switch (input->wlr_input_device->type) {
case WLR_INPUT_DEVICE_KEYBOARD: case WLR_INPUT_DEVICE_KEYBOARD:
configure_libinput(input->wlr_input_device);
configure_keyboard(seat, input); configure_keyboard(seat, input);
break; break;
case WLR_INPUT_DEVICE_POINTER: case WLR_INPUT_DEVICE_POINTER: