Skip to content

Commit 75d9965

Browse files
committed
Docking: move DockTabItemStatusFlags stuff next to its peers in DC structure.
1 parent db4e541 commit 75d9965

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

imgui.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -4816,7 +4816,7 @@ static void ImGui::SetLastItemDataForWindow(ImGuiWindow* window, const ImRect& r
48164816
{
48174817
ImGuiContext& g = *GImGui;
48184818
if (window->DockIsActive)
4819-
SetLastItemData(window->MoveId, g.CurrentItemFlags, window->DockTabItemStatusFlags, window->DockTabItemRect);
4819+
SetLastItemData(window->MoveId, g.CurrentItemFlags, window->DC.DockTabItemStatusFlags, window->DC.DockTabItemRect);
48204820
else
48214821
SetLastItemData(window->MoveId, g.CurrentItemFlags, window->DC.WindowItemStatusFlags, rect);
48224822
}
@@ -18537,8 +18537,8 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
1853718537
node->VisibleWindow = window;
1853818538

1853918539
// Store last item data so it can be queried with IsItemXXX functions after the user Begin() call
18540-
window->DockTabItemStatusFlags = g.LastItemData.StatusFlags;
18541-
window->DockTabItemRect = g.LastItemData.Rect;
18540+
window->DC.DockTabItemStatusFlags = g.LastItemData.StatusFlags;
18541+
window->DC.DockTabItemRect = g.LastItemData.Rect;
1854218542

1854318543
// Update navigation ID on menu layer
1854418544
if (g.NavWindow && g.NavWindow->RootWindow == window && (window->DC.NavLayersActiveMask & (1 << ImGuiNavLayer_Menu)) == 0)

imgui_internal.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -2668,8 +2668,12 @@ struct IMGUI_API ImGuiWindowTempData
26682668
ImGuiLayoutType LayoutType;
26692669
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
26702670
ImU32 ModalDimBgColor;
2671+
2672+
// Status flags
26712673
ImGuiItemStatusFlags WindowItemStatusFlags;
26722674
ImGuiItemStatusFlags ChildItemStatusFlags;
2675+
ImGuiItemStatusFlags DockTabItemStatusFlags;
2676+
ImRect DockTabItemRect;
26732677

26742678
// Local parameters stacks
26752679
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
@@ -2809,8 +2813,6 @@ struct IMGUI_API ImGuiWindow
28092813
ImGuiDockNode* DockNode; // Which node are we docked into. Important: Prefer testing DockIsActive in many cases as this will still be set when the dock node is hidden.
28102814
ImGuiDockNode* DockNodeAsHost; // Which node are we owning (for parent windows)
28112815
ImGuiID DockId; // Backup of last valid DockNode->ID, so single window remember their dock node id even when they are not bound any more
2812-
ImGuiItemStatusFlags DockTabItemStatusFlags;
2813-
ImRect DockTabItemRect;
28142816

28152817
public:
28162818
ImGuiWindow(ImGuiContext* context, const char* name);

0 commit comments

Comments
 (0)