xinput2: correct horizontal touchpad scrolling direction

This fixes testmouse so when fingers move left the green line moves
left.

(cherry picked from commit 5e0f721fd4)
This commit is contained in:
David Vanderson
2026-04-13 14:24:27 -04:00
committed by Frank Praznik
parent 88acac053a
commit d6f7b314b3

View File

@@ -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;