|
@@ -5111,16 +5111,19 @@ void ImGui::OpenPopupEx(ImGuiID id)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // Close child popups if any
|
|
|
- g.OpenPopupStack.resize(current_stack_size + 1);
|
|
|
-
|
|
|
// Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui
|
|
|
// would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing
|
|
|
// situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand.
|
|
|
if (g.OpenPopupStack[current_stack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1)
|
|
|
+ {
|
|
|
g.OpenPopupStack[current_stack_size].OpenFrameCount = popup_ref.OpenFrameCount;
|
|
|
+ }
|
|
|
else
|
|
|
+ {
|
|
|
+ // Close child popups if any, then flag popup for open/reopen
|
|
|
+ g.OpenPopupStack.resize(current_stack_size + 1);
|
|
|
g.OpenPopupStack[current_stack_size] = popup_ref;
|
|
|
+ }
|
|
|
|
|
|
// When reopening a popup we first refocus its parent, otherwise if its parent is itself a popup it would get closed by ClosePopupsOverWindow().
|
|
|
// This is equivalent to what ClosePopupToLevel() does.
|