Skip to content

Commit

Permalink
This change looks okay in the general case.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Oct 27, 2018
1 parent be8ef94 commit 14c55ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/joystick/hidapi/SDL_hidapijoystick.c
Expand Up @@ -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;
Expand All @@ -319,6 +320,7 @@ HIDAPI_UpdateDiscovery()
}
}
#endif
#endif /* __WIN32__ */

#if defined(__MACOSX__)
if (SDL_HIDAPI_discovery.m_notificationPort) {
Expand Down

0 comments on commit 14c55ac

Please sign in to comment.