Преглед на файлове

Wait for devices to finish initializing when inserted, before using them. Fixes hotplug issue with XBox 360 game controller.

Sam Lantinga преди 11 години
родител
ревизия
507157abdb
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      src/core/linux/SDL_udev.c

+ 3 - 0
src/core/linux/SDL_udev.c

@@ -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);