Fixed GetFrontMostModalRootWindow() (#604)

This commit is contained in:
ocornut 2016-04-26 11:59:56 +02:00
parent ea6b615179
commit 544ba36bf6

View File

@ -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;