mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 05:56:24 +08:00
Fixed HIDAPI hotplug detection when initializing gamepads off the main thread
This commit is contained in:
@@ -388,7 +388,9 @@ static void HIDAPI_UpdateDiscovery(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
||||||
#if 0 // just let the usual SDL_PumpEvents loop dispatch these, fixing bug 4286. --ryan.
|
if (SDL_IsMainThread()) {
|
||||||
|
// just let the usual SDL_PumpEvents loop dispatch these, fixing bug 2998. --ryan.
|
||||||
|
} else {
|
||||||
// We'll only get messages on the same thread that created the window
|
// We'll only get messages on the same thread that created the window
|
||||||
if (SDL_GetCurrentThreadID() == SDL_HIDAPI_discovery.m_nThreadID) {
|
if (SDL_GetCurrentThreadID() == SDL_HIDAPI_discovery.m_nThreadID) {
|
||||||
MSG msg;
|
MSG msg;
|
||||||
@@ -399,7 +401,7 @@ static void HIDAPI_UpdateDiscovery(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_MACOS
|
#ifdef SDL_PLATFORM_MACOS
|
||||||
|
|||||||
Reference in New Issue
Block a user