Skip to content

Commit

Permalink
imgui: fix End call when window is collapsed (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciuslrangel authored Sep 9, 2024
1 parent e3c2a91 commit a0cf4ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/core/libraries/system/msgdialog_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -266,8 +265,8 @@ void MsgDialogUi::Draw() {
DrawSystemMessage();
break;
}
End();
}
End();

first_render = false;
}
6 changes: 4 additions & 2 deletions src/imgui/layer/video_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit a0cf4ce

Please sign in to comment.