SDL: Allow other applications to open controllers on macOS

From fa41ece65f50cbfe5043a5d49911e37e60ebad5e Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 3 Jun 2023 11:53:36 -0700
Subject: [PATCH] Allow other applications to open controllers on macOS

---
 src/hidapi/SDL_hidapi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c
index 2082b6d28773..84a4b9eb4bb1 100644
--- a/src/hidapi/SDL_hidapi.c
+++ b/src/hidapi/SDL_hidapi.c
@@ -1195,6 +1195,10 @@ int SDL_hid_init(void)
         return -1;
     }
 
+#ifdef __MACOS__
+    hid_darwin_set_open_exclusive(0);
+#endif
+
     ++SDL_hidapi_refcount;
     return 0;
 }