Skip to main content

Module eiclient

Module eiclient 

Source
Expand description

libei (EIS) input injection over a portal session’s ConnectToEIS socket. libei (EIS) input injection for the portal host-capture rung.

GNOME and KDE hand a RemoteDesktop session an EIS socket through ConnectToEIS; this drives keyboard, pointer, and touch over that socket instead of the portal’s Notify* D-Bus methods. It is the lower-latency channel — one socket write per event, no bus round trip — and the one the backends develop, so it is preferred wherever the portal offers it. The frontend makes the choice permanent: once ConnectToEIS succeeds the Notify* methods are refused for the life of the session, so the injector is taken only after its handshake binds a usable device, and a portal that never answers ConnectToEIS keeps the Notify* path (portal.rs).

All socket I/O runs on one thread: it completes the handshake, binds the seat’s capabilities, tracks the devices the server creates, and emits queued events, waking from a pipe the moment an event is queued so injection does not wait on a poll tick. Keyboard keys arrive as xkb keycodes under selkies’ managed keymap; the compositor’s own keymap (delivered over EIS) is read-only here, so a key’s base keysym is resolved against it and the modifiers its level needs are synthesized, with a raw-keycode fallback for a keysym that keymap does not carry.