We now have the matching code in the server to set the console to RAW mode and
don't need to grab the devices anymore.
This is an updated version of e8534d47c8, which
was reverted in 6dc4199155.
Coming back from resume may leave us with a file descriptor that can be opened
but fails on the first read (ENODEV).
In this case, try to open the device until it becomes available or until the
predefined count expires. To be safe, we cache the information from the device
and compare against it when we re-open. This way we ensure that if the
topology changes under us, we don't open a completely different device. If a
device has changed, we disable it.
Adds option "ReopenAttempts" <int>
Grabbing event devices stops in-kernel event forwarding, most notably rfkill
and the "Macintosh mouse button emulation" device. Let's not do that.
Option "GrabDevice" forces grabbing the device.
Devices may report middle mouse buttons even if they don't have one (PS/2
devices just don't know any better), so we can't be sure until we see the
event.