|
@@ -3567,6 +3567,11 @@ void ImGui::OpenPopupEx(ImGuiID id, bool reopen_existing)
|
|
|
{
|
|
|
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 CloseInactivePopups().
|
|
|
+ // This is equivalent to what ClosePopupToLevel() does.
|
|
|
+ if (g.OpenPopupStack[current_stack_size].PopupId == id)
|
|
|
+ FocusWindow(window);
|
|
|
}
|
|
|
}
|
|
|
|