From 5dfccd4a04ed8505bcc195b95c7c8fa40376426c Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 25 Jun 2020 22:34:31 -0400 Subject: [PATCH] [ion/simulator] Relayout on any windows event We might be relayouting a bit too often, but better safe than sorry! Jokes aside, most SDL_WINDOWEVENT should trigger a relayout, and in general those events aren't triggered on a regular basis anyway. --- ion/src/simulator/shared/events_keyboard.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ion/src/simulator/shared/events_keyboard.cpp b/ion/src/simulator/shared/events_keyboard.cpp index 61fe0f972..806372e19 100644 --- a/ion/src/simulator/shared/events_keyboard.cpp +++ b/ion/src/simulator/shared/events_keyboard.cpp @@ -175,9 +175,8 @@ Event getPlatformEvent() { while (SDL_PollEvent(&event)) { // The while is important: it'll do a fast-pass over all useless SDL events if (event.type == SDL_WINDOWEVENT) { - if (event.window.event == SDL_WINDOWEVENT_RESIZED) { - Ion::Simulator::Main::relayout(); - } + Ion::Simulator::Main::relayout(); + break; } if (event.type == SDL_QUIT) { result = Termination;