فهرست منبع

Fixed GetFrontMostModalRootWindow() (#604)

ocornut 9 سال پیش
والد
کامیت
544ba36bf6
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      imgui.cpp

+ 2 - 2
imgui.cpp

@@ -3210,8 +3210,8 @@ static void CloseInactivePopups()
 static ImGuiWindow* GetFrontMostModalRootWindow()
 {
     ImGuiState& g = *GImGui;
-    if (!g.OpenedPopupStack.empty())
-        if (ImGuiWindow* front_most_popup = g.OpenedPopupStack.back().Window)
+    for (int n = g.OpenedPopupStack.Size-1; n >= 0; n--)
+        if (ImGuiWindow* front_most_popup = g.OpenedPopupStack.Data[n].Window)
             if (front_most_popup->Flags & ImGuiWindowFlags_Modal)
                 return front_most_popup;
     return NULL;