From e714f6590ef4f8ad46243c511e5c0582ee4f732a Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Tue, 7 Aug 2018 12:06:31 -0400 Subject: [PATCH] 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index 9c11a2f0e..2f6bd4059 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/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;