diff --git a/imgui.cpp b/imgui.cpp index a4322bdf7c5e3..9ad35d3ecbf75 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5511,7 +5511,7 @@ static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, { ImGuiContext& g = *GImGui; - const bool new_is_explicit_child = (new_flags & ImGuiWindowFlags_ChildWindow) != 0; + const bool new_is_explicit_child = (new_flags & ImGuiWindowFlags_ChildWindow) != 0 && (new_flags & ImGuiWindowFlags_Popup) == 0; const bool child_flag_changed = new_is_explicit_child != window->IsExplicitChild; if ((just_created || child_flag_changed) && !new_is_explicit_child) {