diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2019-11-17 09:33:26 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2020-01-13 16:50:58 -0600 |
| commit | e2d5c92c76b837e3e4935812c7ffde3be5fa7a91 (patch) | |
| tree | f57f8698ff5523e3f8a4c17383f04ccc1e964f0e /Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | |
| parent | aabe8d2ccdd46c0366c968dfa9abd80f6c93dbbd (diff) | |
ControllerInterface: Remove and re-add device when combining nodes.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp')
| -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 { |
