mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-09-05 15:41:28 +03:00
`EiEvent::DeviceRemoved` currently tears down and recreates the whole input-capture session. That is a workaround for mutter, which stops delivering events after a device change, but it is applied on every compositor. Elsewhere the restart is pure overhead: every device change costs a CreateSession + ConnectToEIS round trip. On compositors that keep per-session state around it is worse than overhead - Hyprland keeps a keymap fd per EIS session and never reaps sessions whose client went away, so the churn drives it out of file descriptors and eventually crashes it. On this machine the churn ran at ~35 ConnectToEIS per 38 minutes; gating it to GNOME brought that to 0 with no change in capture behaviour. `SeatRemoved` still releases unconditionally - a seat going away really does invalidate the session. The default is derived from XDG_CURRENT_DESKTOP and can be overridden with LM_RESTART_SESSION_ON_DEVICE_CHANGE=1/0 for compositors that need the mutter behaviour but do not advertise themselves as GNOME.