diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m index 38ab3fe60..666c1c1cd 100644 --- a/src/joystick/iphoneos/SDL_mfijoystick.m +++ b/src/joystick/iphoneos/SDL_mfijoystick.m @@ -180,6 +180,10 @@ IsControllerXbox(GCController *controller) static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCController *controller) { + if ((@available(macOS 11.3, *)) && !GCController.shouldMonitorBackgroundEvents) { + GCController.shouldMonitorBackgroundEvents = YES; + } + Uint16 *guid16 = (Uint16 *)device->guid.data; Uint16 vendor = 0; Uint16 product = 0; @@ -588,10 +592,6 @@ IOS_JoystickInit(void) return 0; } - if (@available(macOS 11.3, iOS 14.5, tvOS 14.5, *)) { - GCController.shouldMonitorBackgroundEvents = YES; - } - /* For whatever reason, this always returns an empty array on macOS 11.0.1 */ for (GCController *controller in [GCController controllers]) {