SDL: Messages posted on the same tick are not new

From 0b6a821188e2456e196a30864f59f0e6d2f3dbf4 Mon Sep 17 00:00:00 2001
From: Brick <[EMAIL REDACTED]>
Date: Tue, 12 Oct 2021 14:08:20 +0100
Subject: [PATCH] Messages posted on the same tick are not new

---
 src/video/windows/SDL_windowsevents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 2b68765da4..6307fac70e 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -1525,7 +1525,7 @@ WIN_PumpEvents(_THIS)
 {
     const Uint8 *keystate;
     MSG msg;
-    DWORD start_ticks = GetTickCount();
+    DWORD end_ticks = GetTickCount() + 1;
     int new_messages = 0;
 
     if (g_WindowsEnableMessageLoop) {
@@ -1549,7 +1549,7 @@ WIN_PumpEvents(_THIS)
             DispatchMessage(&msg);
 
             /* Make sure we don't busy loop here forever if there are lots of events coming in */
-            if (SDL_TICKS_PASSED(msg.time, start_ticks)) {
+            if (SDL_TICKS_PASSED(msg.time, end_ticks)) {
                 /* We might get a few new messages generated by the Steam overlay or other application hooks
                    In this case those messages will be processed before any pending input, so we want to continue after those messages.
                    (thanks to Peter Deayton for his investigation here)