SDL: Don't process WM_INPUT when handling relative mode by warping the mouse cursor

From 7fb43643914a2d769191aa476422a915c2ed7ed7 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 17 Oct 2021 13:56:31 -0700
Subject: [PATCH] Don't process WM_INPUT when handling relative mode by warping
 the mouse cursor

---
 src/video/windows/SDL_windowsevents.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 5ec7b84ef9..4c5b941c04 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -724,8 +724,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
             RAWINPUT inp;
             UINT size = sizeof(inp);
 
+            /* We only use raw mouse input in relative mode */
+            if (!mouse->relative_mode || mouse->relative_mode_warp) {
+                break;
+            }
+
             /* Relative mouse motion is delivered to the window with keyboard focus */
-            if ((!mouse->relative_mode && !mouse->relative_mode_warp) || data->window != SDL_GetKeyboardFocus()) {
+            if (data->window != SDL_GetKeyboardFocus()) {
                 break;
             }