SDL: SDL_WINDOW_INPUT_GRABBED has been renamed SDL_WINDOW_MOUSE_GRABBED

From 31f464153d121ec9484ce3d10b1afd77a17eb563 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 28 Jan 2023 09:55:27 -0800
Subject: [PATCH] SDL_WINDOW_INPUT_GRABBED has been renamed
 SDL_WINDOW_MOUSE_GRABBED

---
 build-scripts/SDL_migration.cocci | 4 ++++
 docs/README-migration.md          | 3 +++
 include/SDL3/SDL_oldnames.h       | 2 ++
 include/SDL3/SDL_shape.h          | 2 +-
 include/SDL3/SDL_video.h          | 3 +--
 5 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index f167a156ae81..7b6f41e00b27 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -2330,3 +2330,7 @@ expression e;
 @@
 - SDL_WINDOW_FULLSCREEN
 + SDL_WINDOW_FULLSCREEN_EXCLUSIVE
+@@
+@@
+- SDL_WINDOW_INPUT_GRABBED
++ SDL_WINDOW_MOUSE_GRABBED
diff --git a/docs/README-migration.md b/docs/README-migration.md
index 67cadb4bad15..ad4c1d38ef48 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -979,6 +979,9 @@ SDL_Window id type is named SDL_WindowID
 
 SDL_WINDOW_FULLSCREEN has been renamed SDL_WINDOW_FULLSCREEN_EXCLUSIVE, and SDL_WINDOW_FULLSCREEN_DESKTOP no longer includes the old SDL_WINDOW_FULLSCREEN flag. You can use `(SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN_MASK) != 0` if you want to check for either state.
 
+The following symbols have been renamed:
+* SDL_WINDOW_INPUT_GRABBED => SDL_WINDOW_MOUSE_GRABBED
+
 ## SDL_vulkan.h
 
 SDL_Vulkan_GetInstanceExtensions() no longer takes a window parameter.
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index ded0461a5cdf..ef033e3a87de 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -416,6 +416,7 @@
 #define SDL_GetPointDisplayIndex SDL_GetDisplayIndexForPoint
 #define SDL_GetRectDisplayIndex SDL_GetDisplayIndexForRect
 #define SDL_WINDOW_FULLSCREEN SDL_WINDOW_FULLSCREEN_EXCLUSIVE
+#define SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_MOUSE_GRABBED
 
 #elif !defined(SDL_DISABLE_OLD_NAMES)
 
@@ -797,6 +798,7 @@
 #define SDL_GetPointDisplayIndex SDL_GetPointDisplayIndex_renamed_SDL_GetDisplayIndexForPoint
 #define SDL_GetRectDisplayIndex SDL_GetRectDisplayIndex_renamed_SDL_GetDisplayIndexForRect
 #define SDL_WINDOW_FULLSCREEN SDL_WINDOW_FULLSCREEN_renamed_SDL_WINDOW_FULLSCREEN_EXCLUSIVE
+#define SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_INPUT_GRABBED_renamed_SDL_WINDOW_MOUSE_GRABBED
 
 #endif /* SDL_ENABLE_OLD_NAMES */
 
diff --git a/include/SDL3/SDL_shape.h b/include/SDL3/SDL_shape.h
index afc5833f01c7..71bc15041c65 100644
--- a/include/SDL3/SDL_shape.h
+++ b/include/SDL3/SDL_shape.h
@@ -56,7 +56,7 @@ extern "C" {
  * \param h The height of the window.
  * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
  *              any of the following: ::SDL_WINDOW_OPENGL,
- *              ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN,
+ *              ::SDL_WINDOW_MOUSE_GRABBED, ::SDL_WINDOW_HIDDEN,
  *              ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
  *              ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set,
  *              and ::SDL_WINDOW_FULLSCREEN_MASK is always unset.
diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h
index cefa8c21eb0d..0aca0c0962a5 100644
--- a/include/SDL3/SDL_video.h
+++ b/include/SDL3/SDL_video.h
@@ -131,7 +131,6 @@ typedef enum
     SDL_WINDOW_VULKAN               = 0x10000000,   /**< window usable for Vulkan surface */
     SDL_WINDOW_METAL                = 0x20000000,   /**< window usable for Metal view */
 
-    SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED /**< equivalent to SDL_WINDOW_MOUSE_GRABBED for compatibility */
 } SDL_WindowFlags;
 
 #define SDL_WINDOW_FULLSCREEN_MASK  (SDL_WINDOW_FULLSCREEN_EXCLUSIVE | SDL_WINDOW_FULLSCREEN_DESKTOP)
@@ -658,7 +657,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window);
  * - `SDL_WINDOW_RESIZABLE`: window can be resized
  * - `SDL_WINDOW_MINIMIZED`: window is minimized
  * - `SDL_WINDOW_MAXIMIZED`: window is maximized
- * - `SDL_WINDOW_INPUT_GRABBED`: window has grabbed input focus
+ * - `SDL_WINDOW_MOUSE_GRABBED`: window has grabbed mouse focus
  *
  * The SDL_Window is implicitly shown if SDL_WINDOW_HIDDEN is not set.
  *