diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 58587b76b8..924367f04e 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -130,6 +130,9 @@ namespace OpenRA [Desc("Disable high resolution DPI scaling on Windows operating systems.")] public bool DisableWindowsDPIScaling = true; + [Desc("Disable separate OpenGL render thread on Windows operating systems.")] + public bool DisableWindowsRenderThread = true; + public int BatchSize = 8192; public int SheetSize = 2048; diff --git a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs index 8f2a7cf280..1c223b0ea3 100644 --- a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs +++ b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs @@ -187,7 +187,16 @@ namespace OpenRA.Platforms.Default // Run graphics rendering on a dedicated thread. // The calling thread will then have more time to process other tasks, since rendering happens in parallel. // If the calling thread is the main game thread, this means it can run more logic and render ticks. - context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize); + // This is disabled on Windows because it breaks the ability to minimize/restore the window from the taskbar for reasons that we dont understand. + var threadedRenderer = Platform.CurrentPlatform != PlatformType.Windows || !Game.Settings.Graphics.DisableWindowsRenderThread; + if (threadedRenderer) + { + var ctx = new Sdl2GraphicsContext(this); + ctx.InitializeOpenGL(); + context = ctx; + } + else + context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize); SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE); input = new Sdl2Input();