From e2d5c92c76b837e3e4935812c7ffde3be5fa7a91 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 17 Nov 2019 09:33:26 -0600 Subject: [PATCH] ControllerInterface: Remove and re-add device when combining nodes. --- .../Core/InputCommon/ControllerInterface/evdev/evdev.cpp | 9 +++++++-- 1 file 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(device) == evdev_device.get(); + }); + + g_controller_interface.AddDevice(evdev_device); } else {