[client] evdev: fix input capture and device handling

Classify configured devices by keyboard and pointer capability so
automatic keyboard capture leaves relative pointer devices with the
display server.

Run descriptor, grab, physical-state, and LED operations on one worker.
Marshal normalized events through each display server's event loop and
serialize ownership changes with per-lane barriers.

Fall back whole lanes to native input when an evdev cohort cannot be
owned, and retry missing or removed devices without disabling the rest.

Handle report framing, SYN_DROPPED, high-resolution wheels, queue
overflow, held-state cleanup, and guest-driven keyboard LEDs. Restore
host LEDs and kernel grabs during teardown.

Re-evaluate capture when the active input transport changes.
This commit is contained in:
Geoffrey McRae
2026-08-21 13:10:34 +10:00
parent 8b38546049
commit 423269802f
12 changed files with 2359 additions and 301 deletions

View File

@@ -3603,7 +3603,7 @@ static int lg_run(void)
}
if (evdev_start())
DEBUG_INFO("Using evdev for keyboard capture");
DEBUG_INFO("Using evdev for input capture");
// override the SIGINIT handler so that we can tell the difference between
// SIGINT and the user sending a close event, such as ALT+F4
@@ -3739,7 +3739,13 @@ static int lg_run(void)
.largeCursorDot = g_params.largeCursorDot,
.allowNoInput = strcmp(g_params.transport, "test") == 0,
.opengl = needsOpenGL,
.jitRender = g_params.jitRender
.jitRender = g_params.jitRender,
.eventSource =
{
.fd = evdev_getEventFD(),
.callback = evdev_dispatch,
.opaque = NULL,
},
};
g_state.dsInitialized = g_state.ds->init(params);