Backport 19471da from ImGui.

https://github.com/ocornut/imgui/issues/4920
This commit is contained in:
Bartosz Taudul 2022-02-03 01:59:56 +01:00
parent f058ad01fc
commit 1a4f369d4a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -6270,7 +6270,9 @@ static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window)
for (int i = g.OpenPopupStack.Size - 1; i >= 0; i--)
{
ImGuiWindow* popup_window = g.OpenPopupStack.Data[i].Window;
if (popup_window == NULL || !popup_window->WasActive || !(popup_window->Flags & ImGuiWindowFlags_Modal)) // Check WasActive, because this code may run before popup renders on current frame.
if (popup_window == NULL || !(popup_window->Flags & ImGuiWindowFlags_Modal))
continue;
if (!popup_window->Active && !popup_window->WasActive) // Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows.
continue;
if (IsWindowWithinBeginStackOf(window, popup_window)) // Window is rendered over last modal, no render order change needed.
break;