Fix crash when reading background events for MFi controllers on macOS

Enabling GCController.shouldMonitorBackgroundEvents to read background events
for MFi controllers before receiving the first GCControllerDidConnectNotification
is apparently a no-go on macOS (12.3.1 for me), and would crash on attempt.
Apple's documentation is... not great, and doesn't point this out.

This waits for IOS_AddMFIJoystickDevice() to get called down the chain from GCControllerDidConnectNotification, and enables GCController.shouldMonitorBackgroundEvents
if it hadn't been already.

On iOS and tvOS, GCController.shouldMonitorBackgroundEvents is ignored, so
there's no need to check their versions.
(cherry picked from commit d1a3981bf866ccf8e802253ee7a150667c1dfc15)
1 file changed
tree: 22320532377923f57540210a6c9454210ebad4f5
  1. .github/
  2. acinclude/
  3. android-project/
  4. android-project-ant/
  5. build-scripts/
  6. cmake/
  7. docs/
  8. include/
  9. src/
  10. test/
  11. VisualC/
  12. VisualC-WinRT/
  13. visualtest/
  14. wayland-protocols/
  15. Xcode/
  16. Xcode-iOS/
  17. .gitignore
  18. Android.mk
  19. autogen.sh
  20. BUGS.txt
  21. cmake_uninstall.cmake.in
  22. CMakeLists.txt
  23. configure
  24. configure.ac
  25. CREDITS.txt
  26. INSTALL.txt
  27. LICENSE.txt
  28. Makefile.in
  29. Makefile.minimal
  30. Makefile.os2
  31. Makefile.pandora
  32. README-SDL.txt
  33. README.md
  34. sdl2-config-version.cmake.in
  35. sdl2-config.cmake.in
  36. sdl2-config.in
  37. sdl2.m4
  38. sdl2.pc.in
  39. SDL2.spec.in
  40. SDL2Config.cmake
  41. TODO.txt
  42. WhatsNew.txt
README.md

Simple DirectMedia Layer (SDL) Version 2.0

https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting with README.md

Enjoy!

Sam Lantinga (slouken@libsdl.org)