Version
3.5-2252
Branch
comex-wiimote-fixes
Date
10 years, 7 months ago
Windows x64 Windows x86 Mac OS X Android
Commit
906de748bd00a09486d2a16b337751c55ebac8f9
Change author
comex
Change description
Refactor thread handling to fix OS X bug.

On OS X, openL2CAPChannelSync registers events on the current
thread's run loop, so Connect needs to be called on a thread that's
going to do CFRunLoopRun; this was causing all Wiimote input to be
ignored.  Easiest way to do that is to use the Wiimote thread, and
have Read call CFRunLoopRun to block on events, bringing OS X's
Wiimote event loop in line with every other platform's.  This also
means that the thread can't be stopped and recreated by Prepare,
so make Prepare notify it instead, which has the side effect of not
making the GUI block on Prepare.  (It would be nice if the GUI also
did not block on searching for devices, because blocking the GUI
is gross, but for now...)