mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-24 12:45:28 +00:00
Fixed XInput correlation for raw input controllers after hotplug events
This commit is contained in:
parent
012471e959
commit
1f2f536bd2
|
@ -635,6 +635,17 @@ RAWINPUT_AcquireDevice(SDL_RAWINPUT_Device *device)
|
||||||
static void
|
static void
|
||||||
RAWINPUT_ReleaseDevice(SDL_RAWINPUT_Device *device)
|
RAWINPUT_ReleaseDevice(SDL_RAWINPUT_Device *device)
|
||||||
{
|
{
|
||||||
|
#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT
|
||||||
|
if (device->joystick) {
|
||||||
|
RAWINPUT_DeviceContext *ctx = device->joystick->hwdata;
|
||||||
|
|
||||||
|
if (ctx->xinput_enabled && ctx->xinput_correlated) {
|
||||||
|
RAWINPUT_MarkXInputSlotFree(ctx->xinput_slot);
|
||||||
|
ctx->xinput_correlated = SDL_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* SDL_JOYSTICK_RAWINPUT_XINPUT */
|
||||||
|
|
||||||
if (SDL_AtomicDecRef(&device->refcount)) {
|
if (SDL_AtomicDecRef(&device->refcount)) {
|
||||||
if (device->preparsed_data) {
|
if (device->preparsed_data) {
|
||||||
SDL_HidD_FreePreparsedData(device->preparsed_data);
|
SDL_HidD_FreePreparsedData(device->preparsed_data);
|
||||||
|
|
Loading…
Reference in a new issue