From 102bf22db83a844ce5deb7c350fff7791ed2fe94 Mon Sep 17 00:00:00 2001
From: Cameron Gutman <[EMAIL REDACTED]>
Date: Thu, 30 Apr 2026 21:57:50 -0500
Subject: [PATCH] haptic: Enable gamepad haptic support under sdl2-compat
(cherry picked from commit c677c913a634a9ecf1e131f089fb31415382b722)
---
src/haptic/SDL_haptic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c
index 5eaf095b4b8ab..577502c922c25 100644
--- a/src/haptic/SDL_haptic.c
+++ b/src/haptic/SDL_haptic.c
@@ -306,9 +306,9 @@ bool SDL_IsJoystickHaptic(SDL_Joystick *joystick)
SDL_LockJoysticks();
{
- // Must be a valid joystick
+ // Must be a valid joystick, but not a gamepad unless running under sdl2-compat
if (SDL_IsJoystickValid(joystick) &&
- !SDL_IsGamepad(SDL_GetJoystickID(joystick))) {
+ (SDL_GetHintBoolean("SDL2_COMPAT", false) || !SDL_IsGamepad(SDL_GetJoystickID(joystick)))) {
#ifdef SDL_JOYSTICK_HIDAPI
result = SDL_SYS_JoystickIsHaptic(joystick) || SDL_HIDAPI_JoystickIsHaptic(joystick);
#else