From c58ff8e37ca7646a4f9dfe0fc3a7e9bf35130c20 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 23 Jan 2023 16:21:58 -0500 Subject: [PATCH] GUI: don't draw at all when minimized --- extern/imgui_patched/backends/imgui_impl_sdl.cpp | 3 --- src/gui/gui.cpp | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/extern/imgui_patched/backends/imgui_impl_sdl.cpp b/extern/imgui_patched/backends/imgui_impl_sdl.cpp index 60094c33f..ac7a674ea 100644 --- a/extern/imgui_patched/backends/imgui_impl_sdl.cpp +++ b/extern/imgui_patched/backends/imgui_impl_sdl.cpp @@ -710,9 +710,6 @@ void ImGui_ImplSDL2_NewFrame() platform_io.Monitors[0].DpiScale=(float)display_w/(float)w; } - logV("io.DisplaySize: %f, %f",io.DisplaySize.x,io.DisplaySize.y); - logV("io.DisplayFramebufferScale: %f, %f",io.DisplayFramebufferScale.x,io.DisplayFramebufferScale.y); - // Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution) static Uint64 frequency = SDL_GetPerformanceFrequency(); Uint64 current_time = SDL_GetPerformanceCounter(); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 9fe9d1222..9fa58f0e6 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3413,6 +3413,11 @@ bool FurnaceGUI::loop() { eventTimeEnd=SDL_GetPerformanceCounter(); + if (SDL_GetWindowFlags(sdlWin)&SDL_WINDOW_MINIMIZED) { + SDL_Delay(100); + continue; + } + layoutTimeBegin=SDL_GetPerformanceCounter(); ImGui_ImplSDLRenderer_NewFrame();