SDL: Only clear the raw input queue status if we don't call GetRawInputBuffer()

From 02c63667c7b8107bb295822376c8d496fe0552b0 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 26 Mar 2024 15:01:19 -0700
Subject: [PATCH] Only clear the raw input queue status if we don't call
 GetRawInputBuffer()

GetRawInputBuffer() will do that for us when we read all the queued events
---
 src/video/windows/SDL_windowsevents.c   | 2 ++
 src/video/windows/SDL_windowsrawinput.c | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index bd4e119161ae7..d0d8eca5d49c9 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -674,6 +674,8 @@ void WIN_PollRawInput(SDL_VideoDevice *_this)
     /* Relative mouse motion is delivered to the window with keyboard focus */
     window = SDL_GetKeyboardFocus();
     if (!window) {
+        // Clear the queue status so MsgWaitForMultipleObjects() will wait again
+        (void)GetQueueStatus(QS_RAWINPUT);
         return;
     }
     data = window->driverdata;
diff --git a/src/video/windows/SDL_windowsrawinput.c b/src/video/windows/SDL_windowsrawinput.c
index ce39fe3609725..fe34f6ff9b3d5 100644
--- a/src/video/windows/SDL_windowsrawinput.c
+++ b/src/video/windows/SDL_windowsrawinput.c
@@ -81,9 +81,6 @@ static DWORD WINAPI WIN_RawInputThread(LPVOID param)
             break;
         }
 
-        /* Clear the queue status so MsgWaitForMultipleObjects() will wait again */
-        (void)GetQueueStatus(QS_RAWINPUT);
-
         WIN_PollRawInput(_this);
     }