From 14c55ac890d5ebddbeec50a7e16649da67130e69 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 26 Oct 2018 20:20:28 -0700 Subject: [PATCH] This change looks okay in the general case. If we run into problems where these events aren't dispatched (initialized on a different thread than the main thread?) we may need to create a separate thread to handle device notifications like we do with the windows joystick subsystem. --- src/joystick/hidapi/SDL_hidapijoystick.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index e89c4f6a9..064cb8204 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -307,7 +307,8 @@ HIDAPI_UpdateDiscovery() return; } -#if 0 /* just let the usual SDL_PumpEvents loop dispatch these. --ryan. defined(__WIN32__)*/ +#if defined(__WIN32__) +#if 0 /* just let the usual SDL_PumpEvents loop dispatch these, fixing bug 4286. --ryan. */ /* We'll only get messages on the same thread that created the window */ if (SDL_ThreadID() == SDL_HIDAPI_discovery.m_nThreadID) { MSG msg; @@ -319,6 +320,7 @@ HIDAPI_UpdateDiscovery() } } #endif +#endif /* __WIN32__ */ #if defined(__MACOSX__) if (SDL_HIDAPI_discovery.m_notificationPort) {