mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
ControllerInterface: invoke callbacks in AddDevice/RemoveDevice
Some backends already cause this to happen, so make it consistent across systems.
This commit is contained in:
@ -92,9 +92,7 @@ static void HotplugThreadFunc()
|
||||
g_controller_interface.RemoveDevice([&name](const auto& device) {
|
||||
return device->GetSource() == "evdev" && device->GetName() == name && !device->IsValid();
|
||||
});
|
||||
NOTICE_LOG(SERIALINTERFACE, "Removed device: %s", name.c_str());
|
||||
s_devnode_name_map.erase(devnode);
|
||||
g_controller_interface.InvokeHotplugCallbacks();
|
||||
}
|
||||
// Only react to "device added" events for evdev devices that we can access.
|
||||
else if (strcmp(action, "add") == 0 && access(devnode, W_OK) == 0)
|
||||
@ -107,8 +105,6 @@ static void HotplugThreadFunc()
|
||||
{
|
||||
g_controller_interface.AddDevice(std::move(device));
|
||||
s_devnode_name_map.insert(std::pair<std::string, std::string>(devnode, name));
|
||||
NOTICE_LOG(SERIALINTERFACE, "Added new device: %s", name.c_str());
|
||||
g_controller_interface.InvokeHotplugCallbacks();
|
||||
}
|
||||
}
|
||||
udev_device_unref(dev);
|
||||
|
Reference in New Issue
Block a user