This change looks okay in the general case.
authorSam Lantinga <slouken@libsdl.org>
Fri, 26 Oct 2018 20:20:28 -0700
changeset 12363aa3ad38b7809
parent 12362 67496c3f9626
child 12364 351a67dbe9c6
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
     1.1 --- a/src/joystick/hidapi/SDL_hidapijoystick.c	Fri Oct 26 14:43:39 2018 -0400
     1.2 +++ b/src/joystick/hidapi/SDL_hidapijoystick.c	Fri Oct 26 20:20:28 2018 -0700
     1.3 @@ -307,7 +307,8 @@
     1.4          return;
     1.5      }
     1.6  
     1.7 -#if 0 /* just let the usual SDL_PumpEvents loop dispatch these. --ryan.   defined(__WIN32__)*/
     1.8 +#if defined(__WIN32__)
     1.9 +#if 0 /* just let the usual SDL_PumpEvents loop dispatch these, fixing bug 4286. --ryan. */
    1.10      /* We'll only get messages on the same thread that created the window */
    1.11      if (SDL_ThreadID() == SDL_HIDAPI_discovery.m_nThreadID) {
    1.12          MSG msg;
    1.13 @@ -319,6 +320,7 @@
    1.14          }
    1.15      }
    1.16  #endif
    1.17 +#endif /* __WIN32__ */
    1.18  
    1.19  #if defined(__MACOSX__)
    1.20      if (SDL_HIDAPI_discovery.m_notificationPort) {