Mac OS X: Better way to stop duplicate joystick reports (thanks, Kyungdahm!).
authorRyan C. Gordon <icculus@icculus.org>
Thu, 19 Feb 2015 23:52:10 -0500
changeset 9370 795d4866e4db
parent 9369 9bb7a7c0a66e
child 9371 375799828431
Mac OS X: Better way to stop duplicate joystick reports (thanks, Kyungdahm!). Fixes Bugzilla #2822.
src/joystick/darwin/SDL_sysjoystick.c
--- a/src/joystick/darwin/SDL_sysjoystick.c	Thu Feb 19 21:51:13 2015 -0500
+++ b/src/joystick/darwin/SDL_sysjoystick.c	Thu Feb 19 23:52:10 2015 -0500
@@ -446,9 +446,9 @@
         return SDL_FALSE;
     }
 
+    IOHIDManagerSetDeviceMatchingMultiple(hidman, matchingArray);
     IOHIDManagerRegisterDeviceMatchingCallback(hidman, JoystickDeviceWasAddedCallback, NULL);
     IOHIDManagerScheduleWithRunLoop(hidman, runloop, SDL_JOYSTICK_RUNLOOP_MODE);
-    IOHIDManagerSetDeviceMatchingMultiple(hidman, matchingArray);
 
     while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) {
         /* no-op. Callback fires once per existing device. */