From b994dd777abf7255c1541e0f49b89dce1abe8cd9 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 30 Aug 2015 11:11:15 +0100 Subject: [PATCH] Fixed OpenPopup() accessing current window, effectively opening "Debug" on an empty window stack --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index ab6e0a0b1..8ecd695e4 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3005,7 +3005,7 @@ static bool IsPopupOpen(ImGuiID id) void ImGui::OpenPopup(const char* str_id) { ImGuiState& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); + ImGuiWindow* window = g.CurrentWindow; ImGuiID id = window->GetID(str_id); int current_stack_size = g.CurrentPopupStack.Size; ImGuiPopupRef popup_ref = ImGuiPopupRef(id, window, window->GetID("##menus"), g.IO.MousePos); // Tagged as new ref because constructor sets Window to NULL (we are passing the ParentWindow info here)