From 0252235e820fb9af6112529e219ba5f2d5c4c1f6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 27 Nov 2020 10:44:53 -0800 Subject: [PATCH] Recheck devices if another API queries raw input for a new device --- src/joystick/windows/SDL_rawinputjoystick.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index 8dd47c0d2..0f505a42e 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -933,6 +933,14 @@ RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, co /* Make sure the device list is completely up to date when we check for device presence */ RAWINPUT_GetPendingDeviceChanges(); + /* If we're being asked about a device, that means another API just detected one, so rescan */ +#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT + xinput_device_change = SDL_TRUE; +#endif +#ifdef SDL_JOYSTICK_RAWINPUT_WGI + wgi_state.need_device_list_update = SDL_TRUE; +#endif + device = SDL_RAWINPUT_devices; while (device) { if (vendor_id == device->vendor_id && product_id == device->product_id ) {