Skip to content

Commit

Permalink
Docking: Fix undocking window node causing parent window to become un…
Browse files Browse the repository at this point in the history
…responsive. (ocornut#5503)
  • Loading branch information
rokups committed Aug 1, 2022
1 parent cb8ead1 commit 13f5a09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Docking+Viewports Branch:
it only contained the standard Collapse/Close buttons and no actual menu. (#5463, #4792)
- Docking: Fixed regression introduced in v1.87 when docked window content not rendered
while switching between with CTRL+Tab. [@rokups]
- Docking: Fixed undocking window node causing parent window to become unresponsive. (#5503) [@rokups]
- Backends: GLFW: Fixed leftover static variable preventing from changing or
reinitializing backend while application is running. (#4616, #5434) [@rtoumazet]

Expand Down
16 changes: 8 additions & 8 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14422,14 +14422,6 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
new_node->SizeRef = node->SizeRef;
DockNodeMoveWindows(new_node, node);
DockSettingsRenameNodeReferences(node->ID, new_node->ID);
for (int n = 0; n < new_node->Windows.Size; n++)
{
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;
}
else
Expand All @@ -14442,6 +14434,14 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
node->ParentNode->AuthorityForViewport = ImGuiDataAuthority_Window; // The node that stays in place keeps the viewport, so our newly dragged out node will create a new viewport
node->ParentNode = NULL;
}
for (int n = 0; n < node->Windows.Size; n++)
{
ImGuiWindow* window = node->Windows[n];
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
if (window->ParentWindow)
window->ParentWindow->DC.ChildWindows.find_erase(window);
UpdateWindowParentAndRootLinks(window, window->Flags, NULL);
}
node->AuthorityForPos = node->AuthorityForSize = ImGuiDataAuthority_DockNode;
node->Size = FixLargeWindowsWhenUndocking(node->Size, node->Windows[0]->Viewport);
node->WantMouseMove = true;
Expand Down

0 comments on commit 13f5a09

Please sign in to comment.