mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Remove devices from the list after they've been disconnected due to read errors.
This fixes problems with controllers not being re-detected when a computer goes to sleep and a controller is removed and plugged back in while it's asleep.
This commit is contained in:
parent
08547adb52
commit
42607909a0
@ -898,12 +898,13 @@ HIDAPI_UpdateDeviceList(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove any devices that weren't seen */
|
/* Remove any devices that weren't seen or have been disconnected due to read errors */
|
||||||
device = SDL_HIDAPI_devices;
|
device = SDL_HIDAPI_devices;
|
||||||
while (device) {
|
while (device) {
|
||||||
SDL_HIDAPI_Device *next = device->next;
|
SDL_HIDAPI_Device *next = device->next;
|
||||||
|
|
||||||
if (!device->seen) {
|
if (!device->seen ||
|
||||||
|
(device->driver && device->num_joysticks == 0 && !device->dev)) {
|
||||||
HIDAPI_DelDevice(device);
|
HIDAPI_DelDevice(device);
|
||||||
}
|
}
|
||||||
device = next;
|
device = next;
|
||||||
|
Loading…
Reference in New Issue
Block a user