From 03fcb18809dbe7fbad1ccfc8f2fc95ce7036c3c9 Mon Sep 17 00:00:00 2001 From: Simon Rodriguez Date: Sun, 8 Oct 2023 12:29:41 +0200 Subject: [PATCH] Window: fix minimizing on some platforms. --- src/engine/system/Window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/system/Window.cpp b/src/engine/system/Window.cpp index ab9c0a8f..dfe79526 100644 --- a/src/engine/system/Window.cpp +++ b/src/engine/system/Window.cpp @@ -168,6 +168,12 @@ bool Window::nextFrame() { do { // Update events (inputs,...). Input::manager().update(); + // On some platforms, when the window is minimized, the swapchain is invalidated and expected to have a 0,0 extent + // which is technicaly forbidden by the specification, leading to invalidate operations. + // To prevent this, wait for new events without rendering while we are minimized. + if(Input::manager().minimized()){ + continue; + } // Handle quitting. if(_allowEscape && Input::manager().pressed(Input::Key::Escape)) { perform(Action::Quit);