[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

@@ -36,22 +36,31 @@ bool evdev_start(void);
void evdev_stop(void);
/**
* restore the display server hooks and free the device state; only
* call once display server callbacks have stopped
* free the device state; only call once display server callbacks have stopped
*/
void evdev_free(void);
/**
* grab the keyboard for exclusive access
* update the keyboard and pointer capture requirements
*/
void evdev_grabKeyboard(void);
void evdev_setGrab(bool keyboard, bool pointer);
/**
* ungrab the keyboard
* return the event fd used to dispatch captured input
*/
void evdev_ungrabKeyboard(void);
int evdev_getEventFD(void);
/**
* returns true if input should only be processed by evdev
* dispatch captured input on the display server's event thread
*/
void evdev_dispatch(void * opaque);
/**
* return true if keyboard input should only be processed by evdev
*/
bool evdev_isExclusive(void);
/**
* return true if pointer input should only be processed by evdev
*/
bool evdev_isPointerExclusive(void);