SDL: SDL_ClaimWindowForGPUDevice() should fail for transparent windows (ed8e7)

From ed8e7e85f0b7a1a4aab64cef84c35309397216e3 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 21 Mar 2025 11:58:42 -0700
Subject: [PATCH] SDL_ClaimWindowForGPUDevice() should fail for transparent
 windows

The GPU API doesn't currently support transparent windows (transparent swapchain effects doesn't seem possible on D3D12) so we should explicitly fail so users don't expect transparency and then not get it.

Fixes https://github.com/libsdl-org/SDL/issues/12410

(cherry picked from commit 2fbb583290dfbb547f23daaa09e6cb3cf08900cb)
---
 src/gpu/SDL_gpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c
index 0897d1c914684..b7ca6962670a8 100644
--- a/src/gpu/SDL_gpu.c
+++ b/src/gpu/SDL_gpu.c
@@ -2646,8 +2646,11 @@ bool SDL_ClaimWindowForGPUDevice(
 {
     CHECK_DEVICE_MAGIC(device, false);
     if (window == NULL) {
-        SDL_InvalidParamError("window");
-        return false;
+        return SDL_InvalidParamError("window");
+    }
+
+    if ((window->flags & SDL_WINDOW_TRANSPARENT) != 0) {
+        return SDL_SetError("The GPU API doesn't support transparent windows");
     }
 
     return device->ClaimWindow(