MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / DockContextNewFrameUpdateUndocking

Method DockContextNewFrameUpdateUndocking

imgui_tiny_app/imgui/imgui.cpp:17919–17959  ·  view source on GitHub ↗

Docking context update function, called by NewFrame()

Source from the content-addressed store, hash-verified

17917
17918// Docking context update function, called by NewFrame()
17919void ImGui::DockContextNewFrameUpdateUndocking(ImGuiContext* ctx)
17920{
17921 ImGuiContext& g = *ctx;
17922 ImGuiDockContext* dc = &ctx->DockContext;
17923 if (!(g.IO.ConfigFlags & ImGuiConfigFlags_DockingEnable))
17924 {
17925 if (dc->Nodes.Data.Size > 0 || dc->Requests.Size > 0)
17926 DockContextClearNodes(ctx, 0, true);
17927 return;
17928 }
17929
17930 // Setting NoSplit at runtime merges all nodes
17931 if (g.IO.ConfigDockingNoSplit)
17932 for (int n = 0; n < dc->Nodes.Data.Size; n++)
17933 if (ImGuiDockNode* node = (ImGuiDockNode*)dc->Nodes.Data[n].val_p)
17934 if (node->IsRootNode() && node->IsSplitNode())
17935 {
17936 DockBuilderRemoveNodeChildNodes(node->ID);
17937 //dc->WantFullRebuild = true;
17938 }
17939
17940 // Process full rebuild
17941#if 0
17942 if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_C)))
17943 dc->WantFullRebuild = true;
17944#endif
17945 if (dc->WantFullRebuild)
17946 {
17947 DockContextRebuildNodes(ctx);
17948 dc->WantFullRebuild = false;
17949 }
17950
17951 // Process Undocking requests (we need to process them _before_ the UpdateMouseMovingWindowNewFrame call in NewFrame)
17952 for (ImGuiDockRequest& req : dc->Requests)
17953 {
17954 if (req.Type == ImGuiDockRequestType_Undock && req.UndockTargetWindow)
17955 DockContextProcessUndockWindow(ctx, req.UndockTargetWindow);
17956 else if (req.Type == ImGuiDockRequestType_Undock && req.UndockTargetNode)
17957 DockContextProcessUndockNode(ctx, req.UndockTargetNode);
17958 }
17959}
17960
17961// Docking context update function, called by NewFrame()
17962void ImGui::DockContextNewFrameUpdateDocking(ImGuiContext* ctx)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected