| 15682 | } |
| 15683 | |
| 15684 | static void ImGui::DockNodeUpdate(ImGuiDockNode* node) |
| 15685 | { |
| 15686 | ImGuiContext& g = *GImGui; |
| 15687 | IM_ASSERT(node->LastFrameActive != g.FrameCount); |
| 15688 | node->LastFrameAlive = g.FrameCount; |
| 15689 | node->IsBgDrawnThisFrame = false; |
| 15690 | |
| 15691 | node->CentralNode = node->OnlyNodeWithWindows = NULL; |
| 15692 | if (node->IsRootNode()) |
| 15693 | DockNodeUpdateForRootNode(node); |
| 15694 | |
| 15695 | // Remove tab bar if not needed |
| 15696 | if (node->TabBar && node->IsNoTabBar()) |
| 15697 | DockNodeRemoveTabBar(node); |
| 15698 | |
| 15699 | // 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) |
| 15700 | bool want_to_hide_host_window = false; |
| 15701 | if (node->IsFloatingNode()) |
| 15702 | { |
| 15703 | if (node->Windows.Size <= 1 && node->IsLeafNode()) |
| 15704 | if (!g.IO.ConfigDockingAlwaysTabBar && (node->Windows.Size == 0 || !node->Windows[0]->WindowClass.DockingAlwaysTabBar)) |
| 15705 | want_to_hide_host_window = true; |
| 15706 | if (node->CountNodeWithWindows == 0) |
| 15707 | want_to_hide_host_window = true; |
| 15708 | } |
| 15709 | if (want_to_hide_host_window) |
| 15710 | { |
| 15711 | if (node->Windows.Size == 1) |
| 15712 | { |
| 15713 | // Floating window pos/size is authoritative |
| 15714 | ImGuiWindow* single_window = node->Windows[0]; |
| 15715 | node->Pos = single_window->Pos; |
| 15716 | node->Size = single_window->SizeFull; |
| 15717 | node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Window; |
| 15718 | |
| 15719 | // Transfer focus immediately so when we revert to a regular window it is immediately selected |
| 15720 | if (node->HostWindow && g.NavWindow == node->HostWindow) |
| 15721 | FocusWindow(single_window); |
| 15722 | if (node->HostWindow) |
| 15723 | { |
| 15724 | single_window->Viewport = node->HostWindow->Viewport; |
| 15725 | single_window->ViewportId = node->HostWindow->ViewportId; |
| 15726 | if (node->HostWindow->ViewportOwned) |
| 15727 | { |
| 15728 | single_window->Viewport->Window = single_window; |
| 15729 | single_window->ViewportOwned = true; |
| 15730 | } |
| 15731 | } |
| 15732 | } |
| 15733 | |
| 15734 | DockNodeHideHostWindow(node); |
| 15735 | node->State = ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow; |
| 15736 | node->WantCloseAll = false; |
| 15737 | node->WantCloseTabId = 0; |
| 15738 | node->HasCloseButton = node->HasWindowMenuButton = false; |
| 15739 | node->LastFrameActive = g.FrameCount; |
| 15740 | |
| 15741 | if (node->WantMouseMove && node->Windows.Size == 1) |
nothing calls this directly
no test coverage detected