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.
Structs§
- Device 🔒
- One device the server created: its proto object and the emulation state we keep for it.
- EiInjector 🔒
- A handle to a live EIS session: input methods push commands and wake the worker.
- Worker 🔒
Enums§
- Cmd 🔒
- One injection request, produced on selkies’ input threads and drained on the EIS thread.
Constants§
- EVDEV_
OFFSET 🔒 - evdev keycodes carry an 8-count offset from xkb keycodes.
Functions§
- button_
state 🔒 - key_
state 🔒 - keymap_
policy 🔒 - Compile the compositor’s keymap into a resolver over its base layout. The mmap is read once; a keymap that does not compile leaves keys to the raw-keycode path.
- nix_
write 🔒 - A wake byte on the pipe; a full pipe already carries the pending signal.
- now_
micros 🔒 - policy_
altgr 🔒 - The ISO_Level3_Shift (AltGr) keycode of a keymap, as an evdev code, if it carries one.
- policy_
from_ 🔒text - A base-layout resolver over keymap text, or
Nonewhen it does not compile. - policy_
shift 🔒 - The Shift keycode of a keymap, as an evdev code, if it carries one.
Type Aliases§
- Ready 🔒
- The worker’s one-shot readiness report to
spawn: ready once a device bound, else the reason the session yielded no injector.