diff --git a/src/core/application.cpp b/src/core/application.cpp index 04ed7549..2a006a65 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -720,8 +720,12 @@ void Application::run() { int newWidth = event.window.data1; int newHeight = event.window.data2; window->setSize(newWidth, newHeight); + // Mark swapchain dirty so it gets recreated at the correct size + if (window->getVkContext()) { + window->getVkContext()->markSwapchainDirty(); + } // Vulkan viewport set in command buffer, not globally - if (renderer && renderer->getCamera()) { + if (renderer && renderer->getCamera() && newHeight > 0) { renderer->getCamera()->setAspectRatio(static_cast(newWidth) / newHeight); } // Notify addons so UI layouts can adapt to the new size diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index 8749a94e..3864ae1e 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -859,6 +859,8 @@ void Renderer::beginFrame() { // Handle swapchain recreation if needed if (vkCtx->isSwapchainDirty()) { + // Skip recreation while window is minimized (0×0 extent is a Vulkan spec violation) + if (window->getWidth() == 0 || window->getHeight() == 0) return; (void)vkCtx->recreateSwapchain(window->getWidth(), window->getHeight()); // Rebuild water resources that reference swapchain extent/views if (waterRenderer) {