From 5b0861768e30b17369bd6db8173251bf6aa015ca Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 27 May 2015 22:26:03 +0100 Subject: [PATCH] Fixed GetId()/BeginPopup() accessing current window in "append" mode --- imgui.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 9bbc60cf..b5e5c5e1 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3131,7 +3131,7 @@ static void ClearSetNextWindowData() static bool BeginPopupEx(const char* str_id, ImGuiWindowFlags extra_flags) { ImGuiState& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); + ImGuiWindow* window = g.CurrentWindow; const ImGuiID id = window->GetID(str_id); if (!IsPopupOpen(id)) { @@ -5454,20 +5454,17 @@ void ImGui::PopID() ImGuiID ImGui::GetID(const char* str_id) { - ImGuiWindow* window = GetCurrentWindow(); - return window->GetID(str_id); + return GImGui->CurrentWindow->GetID(str_id); } ImGuiID ImGui::GetID(const char* str_id_begin, const char* str_id_end) { - ImGuiWindow* window = GetCurrentWindow(); - return window->GetID(str_id_begin, str_id_end); + return GImGui->CurrentWindow->GetID(str_id_begin, str_id_end); } ImGuiID ImGui::GetID(const void* ptr_id) { - ImGuiWindow* window = GetCurrentWindow(); - return window->GetID(ptr_id); + return GImGui->CurrentWindow->GetID(ptr_id); } // User can input math operators (e.g. +100) to edit a numerical values.