diff options
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp index 3dfae58005..f372812388 100644 --- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp +++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp @@ -251,8 +251,13 @@ void AddDeviceNode(const char* devnode) evdev_device->AddNode(devnode, fd, dev); - // Callbacks must be invoked as the device name and available inputs may change. - g_controller_interface.InvokeDevicesChangedCallbacks(); + // Remove and re-add device as naming and inputs may have changed. + // This will also give it the correct index and invoke device change callbacks. + g_controller_interface.RemoveDevice([&evdev_device](const auto* device) { + return static_cast<const evdevDevice*>(device) == evdev_device.get(); + }); + + g_controller_interface.AddDevice(evdev_device); } else { |
