SDL: Renamed SDL_HINT_ALLOW_TOPMOST to SDL_HINT_WINDOW_ALLOW_TOPMOST

From a5da7d0dd5b714928897f2aa7ad62e15c8d43c02 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 11 Feb 2024 17:52:05 -0800
Subject: [PATCH] Renamed SDL_HINT_ALLOW_TOPMOST to
 SDL_HINT_WINDOW_ALLOW_TOPMOST

---
 build-scripts/SDL_migration.cocci | 4 ++++
 docs/README-migration.md          | 3 +++
 include/SDL3/SDL_hints.h          | 2 +-
 include/SDL3/SDL_oldnames.h       | 6 ++++++
 src/video/SDL_video.c             | 2 +-
 5 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 88e272436d54..8629b97ed189 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -3008,3 +3008,7 @@ typedef SDL_version, SDL_Version;
 @@
 - SDL_version
 + SDL_Version
+@@
+@@
+- SDL_HINT_ALLOW_TOPMOST
++ SDL_HINT_WINDOW_ALLOW_TOPMOST
diff --git a/docs/README-migration.md b/docs/README-migration.md
index f2ba041c435d..80a60ccbf377 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -724,6 +724,9 @@ The following hints have been removed:
 * Renamed environment variables SDL_VIDEODRIVER and SDL_AUDIODRIVER to SDL_VIDEO_DRIVER and SDL_AUDIO_DRIVER
 * The environment variables SDL_VIDEO_X11_WMCLASS and SDL_VIDEO_WAYLAND_WMCLASS have been removed and replaced with the unified hint SDL_HINT_APP_ID
 
+The following hints have been renamed:
+* SDL_HINT_ALLOW_TOPMOST => SDL_HINT_WINDOW_ALLOW_TOPMOST
+
 ## SDL_init.h
 
 The following symbols have been renamed:
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 53ebac381f24..0c024cd96c43 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -2338,7 +2338,7 @@ extern "C" {
  *
  * This hint can be set anytime.
  */
-#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
+#define SDL_HINT_WINDOW_ALLOW_TOPMOST "SDL_WINDOW_ALLOW_TOPMOST"
 
 /**
  * A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index dd743aa705f6..f19757c4c79b 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -279,6 +279,9 @@
 #define SDL_JoystickIsHaptic SDL_IsJoystickHaptic
 #define SDL_MouseIsHaptic SDL_IsMouseHaptic
 
+/* ##SDL_hints.h */
+#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST
+
 /* ##SDL_joystick.h */
 #define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMEPAD
 #define SDL_JoystickAttachVirtual SDL_AttachVirtualJoystick
@@ -751,6 +754,9 @@
 #define SDL_JoystickIsHaptic SDL_JoystickIsHaptic_renamed_SDL_IsJoystickHaptic
 #define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic
 
+/* ##SDL_hints.h */
+#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST
+
 /* ##SDL_joystick.h */
 #define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMECONTROLLER_renamed_SDL_JOYSTICK_TYPE_GAMEPAD
 #define SDL_JoystickAttachVirtual SDL_JoystickAttachVirtual_renamed_SDL_AttachVirtualJoystick
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index f96ae245d9fc..a2f91a94a181 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -5030,7 +5030,7 @@ int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *messag
 
 SDL_bool SDL_ShouldAllowTopmost(void)
 {
-    return SDL_GetHintBoolean(SDL_HINT_ALLOW_TOPMOST, SDL_TRUE);
+    return SDL_GetHintBoolean(SDL_HINT_WINDOW_ALLOW_TOPMOST, SDL_TRUE);
 }
 
 int SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y)