From d6f7b314b331cd02c9b4b86d06da318befcc1cef Mon Sep 17 00:00:00 2001 From: David Vanderson 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. (cherry picked from commit 5e0f721fd4dd98268cdcfcffbc99cce75fae3907) --- 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 21c0f5b15d..05b6c6e3e9 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;