monitor: Implement hot plugging for file-based fallback
Use GFileMonitor
to monitor /dev/input
for added or removed device files
and try to connect to them.
When the files are initially created, they may have wrong permissions. To circumvent this, check if the file has read+write permissions, and if it doesn't, store it as a "potential device" and wait for permission change events. When such an event arrives, see if the file is a potential device and if it's accessible now. If it is, register it.
Disconnecting is more straightforward and is done directly.
Edited by Alice Mikhaylenko