Wait for device to initialize before addDevice

For some reason, hidpp20 device names were badly set (e.g.
'Wireless Mouse MWireless' instead of 'Wireless Mouse MX Master').
Adding a 100ms delay to addDevice seems to have fixed it.
This commit is contained in:
pixl 2020-07-19 01:35:26 -04:00
parent 9607c32520
commit 168c28d1e4
No known key found for this signature in database
GPG Key ID: 1866C148CD593B6E

View File

@ -101,6 +101,8 @@ void DeviceMonitor::run()
if (action == "add")
task::spawn([this, name=devnode]() {
// Wait for device to initialise
std::this_thread::sleep_for(std::chrono::milliseconds(100));
auto supported_reports = backend::hidpp::getSupportedReports(
RawDevice::getReportDescriptor(name));
if(supported_reports)