瀏覽代碼

Fixed OpenPopup() accessing current window, effectively opening "Debug" on an empty window stack

ocornut 10 年之前
父節點
當前提交
b994dd777a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      imgui.cpp

+ 1 - 1
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)