fix: use productCategory instead of vendorName for joy name for apple driver

(cherry picked from commit 964bedfdd9)
This commit is contained in:
Sora authored and Sam Lantinga committed 2025-09-15 11:52:21 -07:00
1 parent 7135779599
commit 93fd4a1c80
1 file changed
+6
+6
View File
@@ -300,9 +300,15 @@ static bool IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCControlle
* struct, and ARC doesn't work with structs. */ * struct, and ARC doesn't work with structs. */
device->controller = (__bridge GCController *)CFBridgingRetain(controller); device->controller = (__bridge GCController *)CFBridgingRetain(controller);
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
if (controller.productCategory) {
name = controller.productCategory.UTF8String;
}
} else {
if (controller.vendorName) { if (controller.vendorName) {
name = controller.vendorName.UTF8String; name = controller.vendorName.UTF8String;
} }
}
if (!name) { if (!name) {
name = "MFi Gamepad"; name = "MFi Gamepad";