diff --git a/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs b/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs index 62cb3cdb4f4..05bfbefefc4 100644 --- a/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs +++ b/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs @@ -332,6 +332,7 @@ public IClydeWindow CreateWindow(WindowCreateParameters parameters) if (parameters.Owner != null) owner = ((WindowHandle)parameters.Owner).Reg; + parameters.Main = isMain; var (reg, error) = _windowing!.WindowCreate(glSpec, parameters, share, owner); if (reg != null) diff --git a/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs b/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs index 2fe5442fcd6..027798a392e 100644 --- a/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs +++ b/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs @@ -219,7 +219,8 @@ private void BlitThreadDoSecondaryWindowBlit(WindowData window) { window.BlitDoneEvent?.Set(); } - Clyde._windowing!.WindowSwapBuffers(window.Reg); + // Single buffered secondary windows, Steam overlay triggers memory leak with secondary double buffers + GL.Finish(); if (!window.UnlockBeforeSwap) { window.BlitDoneEvent?.Set(); diff --git a/Robust.Client/Graphics/Clyde/Windowing/Sdl3.Window.cs b/Robust.Client/Graphics/Clyde/Windowing/Sdl3.Window.cs index dd12203219d..060b2d8c309 100644 --- a/Robust.Client/Graphics/Clyde/Windowing/Sdl3.Window.cs +++ b/Robust.Client/Graphics/Clyde/Windowing/Sdl3.Window.cs @@ -177,6 +177,11 @@ private void WinThreadWinDestroy(CmdWinDestroy cmd) SDL.SDL_GL_SetAttribute( GLAttr.SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, s.Profile == GLContextProfile.Es ? 0 : 1); + + // Steam overlay causes memory leak with multiple double buffered windows + if (!parameters.Main) + SDL.SDL_GL_SetAttribute(GLAttr.SDL_GL_DOUBLEBUFFER, 0); + int ctxFlags = 0; #if DEBUG ctxFlags |= SDL.SDL_GL_CONTEXT_DEBUG_FLAG; diff --git a/Robust.Client/Graphics/WindowCreateParameters.cs b/Robust.Client/Graphics/WindowCreateParameters.cs index 171d4ef83b5..727f7ee9db6 100644 --- a/Robust.Client/Graphics/WindowCreateParameters.cs +++ b/Robust.Client/Graphics/WindowCreateParameters.cs @@ -11,6 +11,7 @@ public sealed class WindowCreateParameters public bool Visible = true; public IClydeMonitor? Monitor; public bool Fullscreen; + public bool Main; /// /// The window that will "own" this window.