# SDL: Merge commit '3e114872e842879c048b2a7808f2cdbfeb2228fe' into main

**URL:** <https://discourse.libsdl.org/t/sdl-merge-commit-3e114872e842879c048b2a7808f2cdbfeb2228fe-into-main/37580>\
**Category:** SDL Commits\
**Created:** [July 6, 2022, 4:50am UTC](https://discourse.libsdl.org/t/sdl-merge-commit-3e114872e842879c048b2a7808f2cdbfeb2228fe-into-main/37580 "2022-07-06T04:50:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [July 6, 2022, 4:50am UTC](https://discourse.libsdl.org/t/sdl-merge-commit-3e114872e842879c048b2a7808f2cdbfeb2228fe-into-main/37580/1 "2022-07-06T04:50:19Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/fbc9800304ae44a7e16224e1a7e61c962a755c72>

```diff
From 3e114872e842879c048b2a7808f2cdbfeb2228fe Mon Sep 17 00:00:00 2001
From: Cameron Gutman <[EMAIL REDACTED]>
Date: Thu, 30 Jun 2022 20:36:45 -0500
Subject: [PATCH] joystick: Fix redetection of HIDAPI joysticks after
 reinitializing

The HIDAPI joystick driver doesn't properly reset the change counter
it uses to track if re-enumeration is needed when the joystick
subsystem is quit and then reinitialized.

The first SDL_Init(SDL_INIT_JOYSTICK) will result in the expected
HIDAPI joysticks appearing, but subsequent calls will result in no
joysticks being enumerated until another HIDAPI joystick is added
or removed from the system.
---
 src/joystick/hidapi/SDL_hidapijoystick.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c
index b0b9a505a52..cf35538d711 100644
--- a/src/joystick/hidapi/SDL_hidapijoystick.c
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c
@@ -1076,6 +1076,7 @@ HIDAPI_JoystickQuit(void)
 
     SDL_hid_exit();
 
+ SDL_HIDAPI_change_count = 0;
     shutting_down = SDL_FALSE;
     initialized = SDL_FALSE;
 }

```
