From d04899fcfd813507cc30406847ab5b33023c1157 Mon Sep 17 00:00:00 2001
From: Antheas Kapenekakis <[EMAIL REDACTED]>
Date: Fri, 1 Aug 2025 19:15:54 +0300
Subject: [PATCH] Fix setting RGB without a player led (#13524)
There is a bug where SInput checks for player led capability before
setting RGB. This means that if a controller does not have a player led,
RGB commands are not sent.
---
src/joystick/hidapi/SDL_hidapi_sinput.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/joystick/hidapi/SDL_hidapi_sinput.c b/src/joystick/hidapi/SDL_hidapi_sinput.c
index 5bee9ad14a2b7..88bec8828af4b 100644
--- a/src/joystick/hidapi/SDL_hidapi_sinput.c
+++ b/src/joystick/hidapi/SDL_hidapi_sinput.c
@@ -632,9 +632,7 @@ static bool HIDAPI_DriverSInput_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Jo
{
SDL_DriverSInput_Context *ctx = (SDL_DriverSInput_Context *)device->context;
- if (ctx->player_leds_supported) {
-
- // Set player number, finalizing the setup
+ if (ctx->joystick_rgb_supported) {
Uint8 joystickRGBCommand[SINPUT_DEVICE_REPORT_COMMAND_SIZE] = { SINPUT_DEVICE_REPORT_ID_OUTPUT_CMDDAT, SINPUT_DEVICE_COMMAND_JOYSTICKRGB, red, green, blue };
int joystickRGBBytesWritten = SDL_hid_write(device->dev, joystickRGBCommand, SINPUT_DEVICE_REPORT_COMMAND_SIZE);