GUI: don't draw at all when minimized

This commit is contained in:
tildearrow 2023-01-23 16:21:58 -05:00
parent 51883f698a
commit c58ff8e37c
2 changed files with 5 additions and 3 deletions

View file

@ -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();

View file

@ -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();