From 2ac1ca133fac669e876e80d4b31202bcc2826d71 Mon Sep 17 00:00:00 2001 From: Vincent Duvert Date: Thu, 19 Jul 2018 08:23:16 +0200 Subject: GCPadWiiUConfigDialog: Update the adapter state dynamically Update the GC adapter config GUI if the adapter is plugged or unplugged. --- Source/Core/InputCommon/GCAdapter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/GCAdapter.cpp') diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index 174e374bf8..a4a4cee5cf 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -122,6 +122,10 @@ static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotpl std::lock_guard lk(s_init_mutex); AddGCAdapter(dev); } + else if (s_status < 0 && s_detect_callback != nullptr) + { + s_detect_callback(); + } } else if (event == LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT) { @@ -130,7 +134,11 @@ static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotpl // Reset a potential error status now that the adapter is unplugged if (s_status < 0) - s_status = 0; + { + s_status = NO_ADAPTER_DETECTED; + if (s_detect_callback != nullptr) + s_detect_callback(); + } } return 0; } -- cgit v1.2.3