Skip to content

Commit

Permalink
Docking+Viewports: Fix undocking window node causing parent viewport …
Browse files Browse the repository at this point in the history
…to become unresponsive. (#5503)

Amend 67be485, Somehow ties to 58f5092 + 0eb45a0 (#4310)
Unsure of exact chain of event but this caused a parent link msimatch between the time of the MouseMoving test in AddUpdateViewport() setting _NoInputs on the wrong parent., and the release clearing _NoInputs on the rght one.
  • Loading branch information
rokups authored and ocornut committed Aug 3, 2022
1 parent b12e056 commit f573ebf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ Docking+Viewports Branch:
- Docking: Fixed regression introduced in v1.87 when docked window content not rendered
while switching between with CTRL+Tab. [@rokups]
- Docking: Fixed amending into an existing tab bar from rendering invisible items. (#5515)
- Docking+Viewports: Fixed undocking window node causing parent viewports to become unresponsive
in certain situation (e.g. hidden tab bar). (#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 @@ -14460,14 +14460,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 @@ -14480,6 +14472,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 f573ebf

Please sign in to comment.