SDL: wayland: Send fake warp coordinates when emulating warps with relative mode

From 8fcbf972c6960fb8882adfb4244e598cffacad6f Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Fri, 16 Aug 2024 11:12:10 -0400
Subject: [PATCH] wayland: Send fake warp coordinates when emulating warps with
 relative 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.
---
 src/video/wayland/SDL_waylandmouse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c
index eb5dde163085f..3043d96824f29 100644
--- a/src/video/wayland/SDL_waylandmouse.c
+++ b/src/video/wayland/SDL_waylandmouse.c
@@ -659,6 +659,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);
     }
 }