mirror of
https://github.com/Drezil/imgui.git
synced 2025-09-18 09:03:13 +02:00
ClosePopupsOverWindow(): amend to remove _ChildWindow test.
Said test seems unnecessary and incorrect as we test hierarchy now. See test "nav_ctrl_tab_popups" in ImGuiTestSuite.
This commit is contained in:
@ -10819,14 +10819,15 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to
|
||||
if (!popup.Window)
|
||||
continue;
|
||||
IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0);
|
||||
if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow)
|
||||
continue;
|
||||
|
||||
// Trim the stack unless the popup is a direct parent of the reference window (the reference window is often the NavWindow)
|
||||
// - With this stack of window, clicking/focusing Popup1 will close Popup2 and Popup3:
|
||||
// Window -> Popup1 -> Popup2 -> Popup3
|
||||
// - Clicking/Focusing Window2 won't close Popup1:
|
||||
// Window -> Popup1 -> Window2(Ref)
|
||||
// - Clicking/focusing Popup1 will close Popup2 and Popup3:
|
||||
// Window -> Popup1(Ref) -> Popup2 -> Popup3
|
||||
// - Each popups may contain child windows, which is why we compare ->RootWindow!
|
||||
// Window -> Popup1 -> Popup1_Child -> Popup2 -> Popup2_Child
|
||||
// We step through every popup from bottom to top to validate their position relative to reference window.
|
||||
bool ref_window_is_descendent_of_popup = false;
|
||||
for (int n = popup_count_to_keep; n < g.OpenPopupStack.Size; n++)
|
||||
if (ImGuiWindow* popup_window = g.OpenPopupStack[n].Window)
|
||||
|
Reference in New Issue
Block a user