Skip to content

Commit

Permalink
Wait for devices to finish initializing when inserted, before using t…
Browse files Browse the repository at this point in the history
…hem. Fixes hotplug issue with XBox 360 game controller.
  • Loading branch information
slouken committed May 25, 2015
1 parent b0c5e20 commit 507157a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/linux/SDL_udev.c
Expand Up @@ -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);
Expand Down

0 comments on commit 507157a

Please sign in to comment.