From 34fd83ca068a7d0d7925589343eb0577a0872bcc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 22 Mar 2022 06:50:10 -0700 Subject: [PATCH] Don't try to hide foreign windows when destroying the SDL window representation Fixes https://github.com/libsdl-org/SDL/issues/5432 --- src/video/SDL_video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index da8c25dc6..8aa87014d 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1770,7 +1770,9 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) } /* Restore video mode, etc. */ - SDL_HideWindow(window); + if (!(window->flags & SDL_WINDOW_FOREIGN)) { + SDL_HideWindow(window); + } /* Tear down the old native window */ if (window->surface) { @@ -3099,7 +3101,9 @@ SDL_DestroyWindow(SDL_Window * window) window->is_destroying = SDL_TRUE; /* Restore video mode, etc. */ - SDL_HideWindow(window); + if (!(window->flags & SDL_WINDOW_FOREIGN)) { + SDL_HideWindow(window); + } /* Make sure this window no longer has focus */ if (SDL_GetKeyboardFocus() == window) {