SDL: Don't warp the mouse within a window while it's minimized

From 1ec409c214225587918911d13432a09e65cacbd9 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 6 Oct 2021 09:09:09 -0700
Subject: [PATCH] Don't warp the mouse within a window while it's minimized

---
 src/events/SDL_mouse.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index e88489c4a5..6bb8307b9d 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -761,6 +761,10 @@ SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
         return;
     }
 
+    if ((window->flags & SDL_WINDOW_MINIMIZED) == SDL_WINDOW_MINIMIZED) {
+        return;
+    }
+
     if (mouse->WarpMouse) {
         mouse->WarpMouse(window, x, y);
     } else {