Skip to content

Commit

Permalink
Window: fix minimizing on some platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
kosua20 committed Oct 8, 2023
1 parent 7f9cf8a commit 03fcb18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engine/system/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 03fcb18

Please sign in to comment.