SDL: video: Preserve the flag to restore popup windows with the parent when recreating the window during renderer initialization

From 969e0842e65ab1bceec029c6bfd585467688d0a0 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Tue, 14 Mar 2023 16:36:41 -0400
Subject: [PATCH] video: Preserve the flag to restore popup windows with the
 parent when recreating the window during renderer initialization

---
 src/video/SDL_video.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 45b9bb0529b8..4b6d8bd5638e 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2077,7 +2077,9 @@ int SDL_RecreateWindow(SDL_Window *window, Uint32 flags)
 
     /* Restore video mode, etc. */
     if (!(window->flags & SDL_WINDOW_FOREIGN)) {
+        const SDL_bool restore_on_show = window->restore_on_show;
         SDL_HideWindow(window);
+        window->restore_on_show = restore_on_show;
     }
 
     /* Tear down the old native window */