libsdl-org / sdl2-compat

An SDL2 compatibility layer that uses SDL3 behind the scenes.
zlib License
65 stars 17 forks source link

Fix invalid joystick index during event filter/watch callbacks #154

Closed cgutman closed 3 months ago

cgutman commented 3 months ago

We need to update IDs before invoking the filters and watches, because Event3to2() calls GetIndexFromJoystickInstance() which needs to be able to find the new ID. Without this, the SDL_JOYDEVADDED event will have the which field set to -1.