hidapi: do not enumerate XInput devices owned by a kernel driver via libusb on macOS
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled

(cherry picked from commit cee2cb8ed1)
This commit is contained in:
tmkk
2026-06-17 06:53:08 -07:00
committed by Sam Lantinga
parent f7aeabb980
commit 31e08f0bad
+11
View File
@@ -1069,6 +1069,17 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
struct hid_device_info *tmp;
res = libusb_open(dev, &handle);
#ifdef SDL_PLATFORM_MACOS
if (res == 0) {
/* Do not enumerate XInput devices already owned by a kernel driver */
int is_xbox = is_xbox360(dev_vid, intf_desc) || is_xboxone(dev_vid, intf_desc);
if (is_xbox && libusb_kernel_driver_active(handle, intf_desc->bInterfaceNumber) == 1) {
libusb_close(handle);
handle = NULL;
continue;
}
}
#endif
#ifdef __ANDROID__
if (handle) {