Fixed opening one Joy-Con when the other is visible but disconnected

This can happen on Windows when the controller is turned off directly. It still shows up in the device list and you can send packets to it, but it's off and doesn't respond. We'll mark this device as broken and open the other as a single Joy-Con.
This commit is contained in:
Sam Lantinga
2025-02-25 18:21:47 -08:00
parent 049a7a04de
commit 34c3734953
4 changed files with 21 additions and 4 deletions

View File

@@ -2727,6 +2727,7 @@ static bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
// Reconnect the Bluetooth device once the USB device is gone
if (device->num_joysticks == 0 && device->is_bluetooth && packet_count > 0 &&
!device->parent &&
!HIDAPI_HasConnectedUSBDevice(device->serial)) {
HIDAPI_JoystickConnected(device, NULL);
}