From 57b95ddd3b16c2f9dd597fa55af40d559d1cc020 Mon Sep 17 00:00:00 2001 From: Nicolas Adenis-Lamarre Date: Wed, 7 Aug 2019 11:27:46 +0100 Subject: [PATCH] fix sdl2 joystick events after joystick closed See: https://bugzilla.libsdl.org/show_bug.cgi?id=4640 --- src/joystick/SDL_joystick.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index dcc1b7440..f8a8639f3 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1047,7 +1047,7 @@ SDL_JoystickUpdate(void) if (joystick->delayed_guide_button) { SDL_GameControllerHandleDelayedGuideButton(joystick); } - } + if (joystick->force_recentering) { /* Tell the app that everything is centered/unpressed... */ @@ -1067,6 +1067,8 @@ SDL_JoystickUpdate(void) joystick->force_recentering = SDL_FALSE; } + + } } SDL_LockJoysticks();