| 19005 | } |
| 19006 | |
| 19007 | static void ImGui::DockNodeUpdate(ImGuiDockNode* node) |
| 19008 | { |
| 19009 | ImGuiContext& g = *GImGui; |
| 19010 | IM_ASSERT(node->LastFrameActive != g.FrameCount); |
| 19011 | node->LastFrameAlive = g.FrameCount; |
| 19012 | node->IsBgDrawnThisFrame = false; |
| 19013 | |
| 19014 | node->CentralNode = node->OnlyNodeWithWindows = NULL; |
| 19015 | if (node->IsRootNode()) |
| 19016 | DockNodeUpdateForRootNode(node); |
| 19017 | |
| 19018 | // Remove tab bar if not needed |
| 19019 | if (node->TabBar && node->IsNoTabBar()) |
| 19020 | DockNodeRemoveTabBar(node); |
| 19021 | |
| 19022 | // Early out for hidden root dock nodes (when all DockId references are in inactive windows, or there is only 1 floating window holding on the DockId) |
| 19023 | bool want_to_hide_host_window = false; |
| 19024 | if (node->IsFloatingNode()) |
| 19025 | { |
| 19026 | if (node->Windows.Size <= 1 && node->IsLeafNode()) |
| 19027 | if (!g.IO.ConfigDockingAlwaysTabBar && (node->Windows.Size == 0 || !node->Windows[0]->WindowClass.DockingAlwaysTabBar)) |
| 19028 | want_to_hide_host_window = true; |
| 19029 | if (node->CountNodeWithWindows == 0) |
| 19030 | want_to_hide_host_window = true; |
| 19031 | } |
| 19032 | if (want_to_hide_host_window) |
| 19033 | { |
| 19034 | if (node->Windows.Size == 1) |
| 19035 | { |
| 19036 | // Floating window pos/size is authoritative |
| 19037 | ImGuiWindow* single_window = node->Windows[0]; |
| 19038 | node->Pos = single_window->Pos; |
| 19039 | node->Size = single_window->SizeFull; |
| 19040 | node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Window; |
| 19041 | |
| 19042 | // Transfer focus immediately so when we revert to a regular window it is immediately selected |
| 19043 | if (node->HostWindow && g.NavWindow == node->HostWindow) |
| 19044 | FocusWindow(single_window); |
| 19045 | if (node->HostWindow) |
| 19046 | { |
| 19047 | IMGUI_DEBUG_LOG_VIEWPORT("[viewport] Node %08X transfer Viewport %08X->%08X to Window '%s'\n", node->ID, node->HostWindow->Viewport->ID, single_window->ID, single_window->Name); |
| 19048 | single_window->Viewport = node->HostWindow->Viewport; |
| 19049 | single_window->ViewportId = node->HostWindow->ViewportId; |
| 19050 | if (node->HostWindow->ViewportOwned) |
| 19051 | { |
| 19052 | single_window->Viewport->ID = single_window->ID; |
| 19053 | single_window->Viewport->Window = single_window; |
| 19054 | single_window->ViewportOwned = true; |
| 19055 | } |
| 19056 | } |
| 19057 | node->RefViewportId = single_window->ViewportId; |
| 19058 | } |
| 19059 | |
| 19060 | DockNodeHideHostWindow(node); |
| 19061 | node->State = ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow; |
| 19062 | node->WantCloseAll = false; |
| 19063 | node->WantCloseTabId = 0; |
| 19064 | node->HasCloseButton = node->HasWindowMenuButton = false; |
nothing calls this directly
no test coverage detected