mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-07 05:41:13 -05:00
Load sizes for HID devices after detection
This commit is contained in:
@@ -78,6 +78,7 @@ std::vector<i2c_smbus_interface*> & ResourceManager::GetI2CBusses()
|
||||
void ResourceManager::RegisterRGBController(RGBController *rgb_controller)
|
||||
{
|
||||
rgb_controllers_hw.push_back(rgb_controller);
|
||||
|
||||
DeviceListChanged();
|
||||
}
|
||||
|
||||
@@ -584,6 +585,24 @@ void ResourceManager::DetectDevicesThreadFunction()
|
||||
DetectionProgressChanged();
|
||||
|
||||
hid_device_detectors[hid_detector_idx].function(current_hid_device, hid_device_detectors[hid_detector_idx].name);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the device list size has changed, call the |
|
||||
| device list changed callbacks |
|
||||
\*-------------------------------------------------*/
|
||||
if(rgb_controllers_hw.size() != prev_count)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| First, load sizes for the new controllers |
|
||||
\*-------------------------------------------------*/
|
||||
for(unsigned int controller_size_idx = prev_count - 1; controller_size_idx < rgb_controllers_hw.size(); controller_size_idx++)
|
||||
{
|
||||
profile_manager->LoadDeviceFromListWithOptions(rgb_controllers_sizes, size_used, rgb_controllers_hw[controller_size_idx], true, false);
|
||||
}
|
||||
|
||||
DeviceListChanged();
|
||||
}
|
||||
prev_count = rgb_controllers_hw.size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user