haptic: Fix initial detection of haptic devices on Linux system
authorMai Lavelle <mai.lavelle@gmail.com>
Tue, 07 Aug 2018 12:06:31 -0400
changeset 12077ca1bbc8b04a1
parent 12075 e1f4191461a0
child 12078 16bb2e8488b8
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.
src/haptic/linux/SDL_syshaptic.c
     1.1 --- a/src/haptic/linux/SDL_syshaptic.c	Mon Aug 06 13:00:11 2018 -0700
     1.2 +++ b/src/haptic/linux/SDL_syshaptic.c	Tue Aug 07 12:06:31 2018 -0400
     1.3 @@ -181,6 +181,9 @@
     1.4          SDL_UDEV_Quit();
     1.5          return SDL_SetError("Could not setup haptic <-> udev callback");
     1.6      }
     1.7 +
     1.8 +    /* Force a scan to build the initial device list */
     1.9 +    SDL_UDEV_Scan();
    1.10  #endif /* SDL_USE_LIBUDEV */
    1.11  
    1.12      return numhaptics;