Start a systemd-logind enabled server with xorg.conf with AutoAddDevices off and a mouse + kbd driver device. server is suid root.
systemd_logind_controls_session() returns 1 if systemd can be initialized, but the devices are /dev/tty and /dev/input/mice. After a VT switch, xf86VTEnter() skips over the xf86EnableInputDeviceForVTSwitch() loop and leaves us with dead devices.
xinput enable <device> restores the devices.
Not 100% sure what we should do there. Maybe check the driver flags for server FD support? Or probably better: remember which devices were opened by systemd-logind and re-enable all but those.
Making xf86VTEnter enable non server-fd enabled devices on vtenter certainly is possible, but TBH I would really like to see people just stop using these drivers on what is otherwise a brand new Linux install (since it is systemd-logingd enabled). So I'm tempted to just refuse to load non server-fd enabled drivers when systemd-logind is enabled. What do you think?
Created attachment 114955 [details] [review]
[PATCH] Re-enable non serverfd input devices immediately on vtenter
Here is the patch which I've just sent to xorg-devel which fixes this.