Skip to content

Commit

Permalink
Manually scan for Linux joysticks before udev scan runs
Browse files Browse the repository at this point in the history
This allows us to have joysticks sorted by insert time at startup, fixing #4688
  • Loading branch information
slouken committed Aug 25, 2021
1 parent cbccf5b commit 130b6be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/joystick/linux/SDL_sysjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,9 @@ LINUX_JoystickInit(void)
last_joy_detect_time = 0;
last_input_dir_mtime = 0;

/* Manually scan first, since we sort by device number and udev doesn't */
LINUX_JoystickDetect();

#if SDL_USE_LIBUDEV
if (enumeration_method == ENUMERATION_LIBUDEV) {
if (SDL_UDEV_Init() < 0) {
Expand Down Expand Up @@ -717,9 +720,6 @@ LINUX_JoystickInit(void)
}
}
#endif /* HAVE_INOTIFY */

/* Report all devices currently present */
LINUX_JoystickDetect();
}

return 0;
Expand Down

0 comments on commit 130b6be

Please sign in to comment.