Don't send Razer devices the Sony third-party query feature report

Some of them lock up or reset, and the vast majority of devices are not actually game controllers.

Fixes https://github.com/libsdl-org/SDL/issues/6733

(cherry picked from commit 83b29f9ce1fe6caa06769544c3b5f6c10ea97a0f)
This commit is contained in:
Sam Lantinga 2022-12-19 09:14:04 -08:00
parent 311b02f0b5
commit 6969b3be3b
2 changed files with 5 additions and 2 deletions

View file

@ -2736,7 +2736,6 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
MAKE_VIDPID(0x04d9, 0x8009), /* OBINLB USB-HID Keyboard (Anne Pro II) */ MAKE_VIDPID(0x04d9, 0x8009), /* OBINLB USB-HID Keyboard (Anne Pro II) */
MAKE_VIDPID(0x04d9, 0xa292), /* OBINLB USB-HID Keyboard (Anne Pro II) */ MAKE_VIDPID(0x04d9, 0xa292), /* OBINLB USB-HID Keyboard (Anne Pro II) */
MAKE_VIDPID(0x04d9, 0xa293), /* OBINLB USB-HID Keyboard (Anne Pro II) */ MAKE_VIDPID(0x04d9, 0xa293), /* OBINLB USB-HID Keyboard (Anne Pro II) */
MAKE_VIDPID(0x1532, 0x0226), /* Razer Huntsman Elite */
MAKE_VIDPID(0x1532, 0x0266), /* Razer Huntsman V2 Analog, non-functional DInput device */ MAKE_VIDPID(0x1532, 0x0266), /* Razer Huntsman V2 Analog, non-functional DInput device */
MAKE_VIDPID(0x1532, 0x0282), /* Razer Huntsman Mini Analog, non-functional DInput device */ MAKE_VIDPID(0x1532, 0x0282), /* Razer Huntsman Mini Analog, non-functional DInput device */
MAKE_VIDPID(0x26ce, 0x01a2), /* ASRock LED Controller */ MAKE_VIDPID(0x26ce, 0x01a2), /* ASRock LED Controller */

View file

@ -49,6 +49,11 @@
#define USB_VENDOR_VALVE 0x28de #define USB_VENDOR_VALVE 0x28de
#define USB_VENDOR_ZEROPLUS 0x0c12 #define USB_VENDOR_ZEROPLUS 0x0c12
// Most Razer devices are not game controllers, and some of them lock up or reset
// when we send them the Sony third-party query feature report, so don't include that
// vendor here. Instead add devices as appropriate to controller_type.c
// Reference: https://github.com/libsdl-org/SDL/issues/6733
// https://github.com/libsdl-org/SDL/issues/6799
#define SONY_THIRDPARTY_VENDOR(X) \ #define SONY_THIRDPARTY_VENDOR(X) \
(X == USB_VENDOR_DRAGONRISE || \ (X == USB_VENDOR_DRAGONRISE || \
X == USB_VENDOR_HORI || \ X == USB_VENDOR_HORI || \
@ -59,7 +64,6 @@
X == USB_VENDOR_POWERA || \ X == USB_VENDOR_POWERA || \
X == USB_VENDOR_POWERA_ALT || \ X == USB_VENDOR_POWERA_ALT || \
X == USB_VENDOR_QANBA || \ X == USB_VENDOR_QANBA || \
X == USB_VENDOR_RAZER || \
X == USB_VENDOR_SHANWAN || \ X == USB_VENDOR_SHANWAN || \
X == USB_VENDOR_SHANWAN_ALT || \ X == USB_VENDOR_SHANWAN_ALT || \
X == USB_VENDOR_THRUSTMASTER || \ X == USB_VENDOR_THRUSTMASTER || \