From a0cf4ce7deab0e777b37f14225c957e17666310d Mon Sep 17 00:00:00 2001 From: Vinicius Rangel Date: Mon, 9 Sep 2024 01:00:19 -0300 Subject: [PATCH] imgui: fix End call when window is collapsed (#850) --- src/core/libraries/system/msgdialog_ui.cpp | 5 ++--- src/imgui/layer/video_info.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/libraries/system/msgdialog_ui.cpp b/src/core/libraries/system/msgdialog_ui.cpp index d69754fe2..63b3390c9 100644 --- a/src/core/libraries/system/msgdialog_ui.cpp +++ b/src/core/libraries/system/msgdialog_ui.cpp @@ -253,8 +253,7 @@ void MsgDialogUi::Draw() { SetNextWindowCollapsed(false); KeepNavHighlight(); // Hack to allow every dialog to have a unique window - if (Begin("Message Dialog##MessageDialog", nullptr, - ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings)) { + if (Begin("Message Dialog##MessageDialog", nullptr, ImGuiWindowFlags_NoSavedSettings)) { switch (state->GetMode()) { case MsgDialogMode::USER_MSG: DrawUser(); @@ -266,8 +265,8 @@ void MsgDialogUi::Draw() { DrawSystemMessage(); break; } - End(); } + End(); first_render = false; } \ No newline at end of file diff --git a/src/imgui/layer/video_info.cpp b/src/imgui/layer/video_info.cpp index 15226cd8c..2a60926fa 100644 --- a/src/imgui/layer/video_info.cpp +++ b/src/imgui/layer/video_info.cpp @@ -9,8 +9,10 @@ void ImGui::Layers::VideoInfo::Draw() { m_show = IsKeyPressed(ImGuiKey_F10, false) ^ m_show; - if (m_show && Begin("Video Info")) { - Text("Frame time: %.3f ms (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + if (m_show) { + if (Begin("Video Info")) { + Text("Frame time: %.3f ms (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + } End(); } }