Related to #315
Unlike other backends (like Linux), the macOS backend only sends single "device connected" events, and doesn't seem to indicate when there are initially-connected devices.
When the CFRunLoop starts, IOHIDManager sends a DeviceMatching event for every already-connected device, one-by-one. If there are multiple devices, this could cause a race condition in DeviceSelector if IOHIDManager is slow to notify, as DeviceSelector would treat it as if there is exactly one device connected.
Monitor::start should call IOHIDManagerCopyDevices to get all the connected devices immediately, and fire a DevicesAdded event like Linux does.
I have a patch for this.
Related to #315
Unlike other backends (like Linux), the macOS backend only sends single "device connected" events, and doesn't seem to indicate when there are initially-connected devices.
When the
CFRunLoopstarts,IOHIDManagersends aDeviceMatchingevent for every already-connected device, one-by-one. If there are multiple devices, this could cause a race condition inDeviceSelectorifIOHIDManageris slow to notify, asDeviceSelectorwould treat it as if there is exactly one device connected.Monitor::startshould callIOHIDManagerCopyDevicesto get all the connected devices immediately, and fire aDevicesAddedevent like Linux does.I have a patch for this.