From 59a37376efdbf1c71228fff85a972363a0d02f67 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 5 Jun 2024 15:56:20 +0200 Subject: [PATCH] TestSuite: amend "window_popup_menu" https://github.com/ocornut/imgui/issues/7654 --- imgui_test_suite/imgui_tests_core.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/imgui_test_suite/imgui_tests_core.cpp b/imgui_test_suite/imgui_tests_core.cpp index a1d88bd..948b644 100644 --- a/imgui_test_suite/imgui_tests_core.cpp +++ b/imgui_test_suite/imgui_tests_core.cpp @@ -1028,13 +1028,15 @@ void RegisterTests_Window(ImGuiTestEngine* e) ctx->MouseSetViewport(window); ctx->MouseMoveToPos(window->Rect().GetBL() + ImVec2(20.0f, -20.0f)); // Clicking parent window of menu popup closes it. ctx->MouseClick(); -#if !IMGUI_BROKEN_TESTS if (vars.UseModal) // FIXME: Closing menu by clicking on a window under the modal { +#if IMGUI_VERSION_NUM >= 19074 + IM_CHECK_EQ(g.OpenPopupStack.Size, 1); // Fixed by #7654 +#else IM_CHECK_EQ(g.OpenPopupStack.Size, 2); ctx->PopupCloseOne(); - } #endif + } IM_CHECK_EQ(vars.FirstOpen, false); IM_CHECK_EQ(vars.SecondOpen, false); IM_CHECK_EQ(popup->Active, vars.UseModal); @@ -1176,7 +1178,7 @@ void RegisterTests_Window(ImGuiTestEngine* e) ImGui::Checkbox("Popup1 is modal", &vars.IsModalPopup[0]); ImGui::Checkbox("Popup2 is modal", &vars.IsModalPopup[1]); ImGui::Combo("Interrupt Kind", &vars.Variant, interrupt_kind, IM_ARRAYSIZE(interrupt_kind)); - ImGui::Text("(Hold CTRL to display interrupting window)"); + ImGui::Checkbox("Show interrupts (Hold CTRL)", &vars.ShowInterrupts); } float spacing = ImFloor(ImGui::GetFontSize() * 2.0f);