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:
		@@ -101,6 +101,8 @@ void DeviceMonitor::run()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if (action == "add")
 | 
					            if (action == "add")
 | 
				
			||||||
                task::spawn([this, name=devnode]() {
 | 
					                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(
 | 
					                    auto supported_reports = backend::hidpp::getSupportedReports(
 | 
				
			||||||
                            RawDevice::getReportDescriptor(name));
 | 
					                            RawDevice::getReportDescriptor(name));
 | 
				
			||||||
                    if(supported_reports)
 | 
					                    if(supported_reports)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user