Skip to content

Commit

Permalink
wayland: Send fake warp coordinates when emulating warps with relativ…
Browse files Browse the repository at this point in the history
…e mode

Send the fake warp coordinates when emulating warps with relative mode to ensure that it appears that the cursor is always reset to where the application expects it to be.

Fixes cases where games can continue moving the camera if the mouse is lifted during motion.

(cherry picked from commit 8fcbf97)
  • Loading branch information
Kontrabant committed Aug 16, 2024
1 parent 74a005f commit f79d280
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/video/wayland/SDL_waylandmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ static void Wayland_WarpMouse(SDL_Window *window, int x, int y)
Wayland_input_lock_pointer(input);
input->relative_mode_override = SDL_TRUE;
}
SDL_SendMouseMotion(window, 0, 0, x, y);
}
}

Expand Down

0 comments on commit f79d280

Please sign in to comment.