Skip to content

Commit

Permalink
perform SPI queries independently
Browse files Browse the repository at this point in the history
  • Loading branch information
expikr committed Nov 11, 2024
1 parent 55d8348 commit afaa82d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/video/windows/SDL_windowsmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,14 @@ void WIN_UpdateMouseSystemScale(void)
data->enhanced = false;

int v;
int params[3];
if (SystemParametersInfo(SPI_GETMOUSESPEED, 0, &v, 0) &&
SystemParametersInfo(SPI_GETMOUSE, 0, &params, 0)) {
if (SystemParametersInfo(SPI_GETMOUSESPEED, 0, &v, 0)) {
v = SDL_max(1, SDL_min(v, 20));
ReadMouseCurve(v, data->xs, data->ys);
data->dpiscale = SDL_max(SDL_max(v, (v - 2) << 2), (v - 6) << 3);
}

int params[3];
if (SystemParametersInfo(SPI_GETMOUSE, 0, &params, 0)) {
ReadMouseCurve(v, data->xs, data->ys);
data->enhanced = params[2] ? true : false;
}
}
Expand Down

0 comments on commit afaa82d

Please sign in to comment.