浏览代码

haptic: Fix initial detection of haptic devices on Linux system

SDL_UDEV_Scan must be called during SDL_SYS_HapticInit to ensure devices
outside of the 0-31 range are added to the list of haptic devices.

Fixes Bugzilla #3923.
Mai Lavelle 7 年之前
父节点
当前提交
e714f6590e
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/haptic/linux/SDL_syshaptic.c

+ 3 - 0
src/haptic/linux/SDL_syshaptic.c

@@ -181,6 +181,9 @@ SDL_SYS_HapticInit(void)
         SDL_UDEV_Quit();
         return SDL_SetError("Could not setup haptic <-> udev callback");
     }
+
+    /* Force a scan to build the initial device list */
+    SDL_UDEV_Scan();
 #endif /* SDL_USE_LIBUDEV */
 
     return numhaptics;