From c95b489d76fd08557b72ebb8a23877b59ff2571c Mon Sep 17 00:00:00 2001 From: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com> Date: Sun, 1 Nov 2026 12:24:18 -0500 Subject: [PATCH] fix game freeze when tabbing out ingame --- Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index aaa3f7fc..4c8497b4 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -2081,11 +2081,11 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // Present the frame. RenderManager.Present() hardcodes SyncInterval=1, // so when VSync is off we bypass it for uncapped frames. In DXGI // exclusive fullscreen this produces real tearing via direct scanout. - // Force VSync on the main menu regardless of user setting: an uncapped - // simple menu scene drives the GPU to thousands of FPS and causes coil - // whine on many cards. - const bool forceVSyncForMenu = !app.GetGameStarted(); - if (!g_bVSync && !forceVSyncForMenu && g_pSwapChain) + // Keep VSync enabled on the main menu and while the game is unfocused. + // Otherwise an uncapped frame loop can saturate the GPU while the player + // is using another window, making the client appear unresponsive. + const bool forceVSync = !app.GetGameStarted() || !g_KBMInput.IsWindowFocused(); + if (!g_bVSync && !forceVSync && g_pSwapChain) { HRESULT hrPresent = g_pSwapChain->Present(0, 0); // If the direct Present fails (e.g. during fullscreen transition),