Skip to content

Commit

Permalink
Docking: fix 58f5092 (ocornut#4310)
Browse files Browse the repository at this point in the history
If we clear _ChildWindow flag we must remove it from here otherwise render loop will fail.
  • Loading branch information
ocornut committed Aug 27, 2021
1 parent 58f5092 commit 0eb45a0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13112,8 +13112,11 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
DockSettingsRenameNodeReferences(node->ID, new_node->ID);
for (int n = 0; n < new_node->Windows.Size; n++)
{
new_node->Windows[n]->Flags &= ~ImGuiWindowFlags_ChildWindow;
UpdateWindowParentAndRootLinks(new_node->Windows[n], new_node->Windows[n]->Flags, NULL);
ImGuiWindow* window = new_node->Windows[n];
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
if (window->ParentWindow)
window->ParentWindow->DC.ChildWindows.find_erase(window);
UpdateWindowParentAndRootLinks(window, window->Flags, NULL);
}
node = new_node;
}
Expand Down Expand Up @@ -13297,6 +13300,8 @@ static void ImGui::DockNodeRemoveWindow(ImGuiDockNode* node, ImGuiWindow* window
window->DockIsActive = window->DockTabWantClose = false;
window->DockId = save_dock_id;
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
if (window->ParentWindow)
window->ParentWindow->DC.ChildWindows.find_erase(window);
UpdateWindowParentAndRootLinks(window, window->Flags, NULL); // Update immediately

// Remove window
Expand Down

0 comments on commit 0eb45a0

Please sign in to comment.