From 5e0f721fd4dd98268cdcfcffbc99cce75fae3907 Mon Sep 17 00:00:00 2001
From: David Vanderson <[EMAIL REDACTED]>
Date: Mon, 13 Apr 2026 14:24:27 -0400
Subject: [PATCH] xinput2: correct horizontal touchpad scrolling direction
This fixes testmouse so when fingers move left the green line moves
left.
---
src/video/x11/SDL_x11xinput2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c
index 4ebba6e0f374e..d6c704e3f6dbf 100644
--- a/src/video/x11/SDL_x11xinput2.c
+++ b/src/video/x11/SDL_x11xinput2.c
@@ -180,7 +180,7 @@ static void xinput2_parse_scrollable_valuators(const XIDeviceEvent *xev)
const double y = info->scroll_type == XIScrollTypeVertical ? delta : 0;
SDL_Mouse *mouse = SDL_GetMouse();
- SDL_SendMouseWheel(xev->time, mouse->focus, (SDL_MouseID)xev->sourceid, (float)x, (float)y, SDL_MOUSEWHEEL_NORMAL);
+ SDL_SendMouseWheel(xev->time, mouse->focus, (SDL_MouseID)xev->sourceid, (float)-x, (float)y, SDL_MOUSEWHEEL_NORMAL);
}
info->prev_value = current_val;
info->prev_value_valid = true;