mirror of
https://github.com/ocornut/imgui.git
synced 2024-10-16 16:25:15 -05:00
Popups: similarly to previous commit, we fix reopening a popup within a popup stack from truncating the whole stack. This is done by properly refocusing the lower level popup. (~#439)
This commit is contained in:
parent
59a89774d7
commit
aca23fd3f0
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue