sdl2-compat: Strip the utility flag when creating popup windows

From 465007e436298b944df7c1e3cfdb7ec6df5ae536 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Thu, 28 Mar 2024 08:12:27 -0400
Subject: [PATCH] Strip the utility flag when creating popup windows

UE5 sets the SDL_WINDOW_UTILITY flags on popup windows, which SDL3 does not allow, causing popup window creation to fail. Strip the flag as it is unnecessary.
---
 src/sdl2_compat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index dfd2167..41d6bf6 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -6158,6 +6158,9 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
         }
 
         if (parent) {
+            /* UE5 mixes the utility flag with popup flags, which SDL3 does not allow. */
+            flags &= ~SDL_WINDOW_UTILITY;
+
             window = SDL3_CreatePopupWindow(parent, x, y, w, h, flags);
             SDL_SetWindowData(window, PROP_WINDOW_PARENT_POINTER, parent);
         }