Sfoglia il codice sorgente

Recover from Bluetooth devices temporarily out of range

Sam Lantinga 3 anni fa
parent
commit
1db7d33dc4
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      src/joystick/hidapi/SDL_hidapijoystick.c

+ 2 - 0
src/joystick/hidapi/SDL_hidapijoystick.c

@@ -1111,6 +1111,8 @@ HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index)
     hwdata->device = device;
     hwdata->device = device;
 
 
     if (!device->driver->OpenJoystick(device, joystick)) {
     if (!device->driver->OpenJoystick(device, joystick)) {
+        /* The open failed, mark this device as disconnected and update devices */
+        HIDAPI_JoystickDisconnected(device, joystickID);
         SDL_free(hwdata);
         SDL_free(hwdata);
         return -1;
         return -1;
     }
     }