mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-26 12:59:18 +01:00
Wait for devices to finish initializing when inserted, before using them. Fixes hotplug issue with XBox 360 game controller.
This commit is contained in:
parent
b0c5e201f8
commit
507157abdb
@ -469,6 +469,9 @@ SDL_UDEV_Poll(void)
|
||||
action = _this->udev_device_get_action(dev);
|
||||
|
||||
if (SDL_strcmp(action, "add") == 0) {
|
||||
/* Wait for the device to finish initialization */
|
||||
SDL_Delay(100);
|
||||
|
||||
device_event(SDL_UDEV_DEVICEADDED, dev);
|
||||
} else if (SDL_strcmp(action, "remove") == 0) {
|
||||
device_event(SDL_UDEV_DEVICEREMOVED, dev);
|
||||
|
Loading…
Reference in New Issue
Block a user