Skip to content

Commit 5f77da3

Browse files
committed
x11: use raw values for relative mouse motion
Fixes #13743
1 parent fe16c62 commit 5f77da3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/video/x11/SDL_x11xinput2.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,14 @@ static void parse_relative_valuators(SDL_XInput2DeviceInfo *devinfo, const XIRaw
8484

8585
for (int j = 0; j < 2; ++j) {
8686
if (devinfo->number[j] == i) {
87-
const double current_val = rawev->valuators.values[values_i];
87+
double current_val = rawev->raw_values[values_i];
8888

8989
if (devinfo->relative[j]) {
9090
processed_coords[j] = current_val;
9191
} else {
92-
processed_coords[j] = devinfo->prev_coords[j] - current_val; // convert absolute to relative
92+
processed_coords[j] = (current_val - devinfo->prev_coords[j]); // convert absolute to relative
93+
devinfo->prev_coords[j] = current_val;
9394
}
94-
95-
devinfo->prev_coords[j] = current_val;
9695
++found;
9796

9897
break;

0 commit comments

Comments
 (0)