From c3fb744f47fe1590911fbca5cae9c55f87c05325 Mon Sep 17 00:00:00 2001 From: Marcus Minhorst Date: Wed, 20 Aug 2025 23:42:02 -0400 Subject: [PATCH] Fix phantom window freezing desktop on some systems --- src/common/platform/posix/sdl/sdlglvideo.cpp | 9 +++------ src/d_main.cpp | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/common/platform/posix/sdl/sdlglvideo.cpp b/src/common/platform/posix/sdl/sdlglvideo.cpp index 92bdb15a7..276181a07 100644 --- a/src/common/platform/posix/sdl/sdlglvideo.cpp +++ b/src/common/platform/posix/sdl/sdlglvideo.cpp @@ -3,6 +3,7 @@ ** **--------------------------------------------------------------------------- ** Copyright 2005-2016 Christoph Oelckers et.al. +** Copyright 2017-2025 GZDoom Maintainers and Contributors ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -446,11 +447,6 @@ IVideo *gl_CreateVideo() SystemBaseFrameBuffer::SystemBaseFrameBuffer (void *, bool fullscreen) : DFrameBuffer (vid_defwidth, vid_defheight) { - if (Priv::window != nullptr) - { - SDL_SetWindowFullscreen(Priv::window, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); - SDL_ShowWindow(Priv::window); - } } int SystemBaseFrameBuffer::GetClientWidth() @@ -485,6 +481,7 @@ bool SystemBaseFrameBuffer::IsFullscreen () void SystemBaseFrameBuffer::ToggleFullscreen(bool yes) { + SDL_ShowWindow(Priv::window); SDL_SetWindowFullscreen(Priv::window, yes ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); if ( !yes ) { @@ -565,7 +562,7 @@ SystemGLFrameBuffer::SystemGLFrameBuffer(void *hMonitor, bool fullscreen) for ( ; glvers[glveridx][0] > 0; ++glveridx) { Priv::SetupPixelFormat(0, glvers[glveridx]); - Priv::CreateWindow(SDL_WINDOW_OPENGL | (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)); + Priv::CreateWindow(SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN | (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)); if (Priv::window == nullptr) { diff --git a/src/d_main.cpp b/src/d_main.cpp index 72621b1fa..1505f880e 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -3,6 +3,7 @@ // Copyright 1993-1996 id Software // Copyright 1999-2016 Randy Heit // Copyright 2002-2016 Christoph Oelckers +// Copyright 2017-2025 GZDoom Maintainers and Contributors // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -3539,6 +3540,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw { return 0; } + setmodeneeded = true; } // [SP] Force vanilla transparency auto-detection to re-detect our game lumps now