diff --git a/imgui.cpp b/imgui.cpp index 7afea92bc..e4c2f2a2e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4714,7 +4714,7 @@ static void ImGui::SetLastItemDataForWindow(ImGuiWindow* window, const ImRect& r static void ImGui::SetLastItemDataForChildWindowItem(ImGuiWindow* window, const ImRect& rect) { ImGuiContext& g = *GImGui; - SetLastItemData(window->ChildId, g.CurrentItemFlags, window->DC.WindowItemStatusFlags, rect); + SetLastItemData(window->ChildId, g.CurrentItemFlags, window->DC.ChildItemStatusFlags, rect); } float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) @@ -6170,7 +6170,7 @@ void ImGui::EndChild() } if (g.HoveredWindow == child_window) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow; - child_window->DC.WindowItemStatusFlags = g.LastItemData.StatusFlags; + child_window->DC.ChildItemStatusFlags = g.LastItemData.StatusFlags; //SetLastItemDataForChildWindowItem(child_window, child_window->Rect()); // Not needed, effectively done by ItemAdd() } else diff --git a/imgui_internal.h b/imgui_internal.h index b7b81c2e2..2922993b3 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -2457,6 +2457,7 @@ struct IMGUI_API ImGuiWindowTempData ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin() ImU32 ModalDimBgColor; ImGuiItemStatusFlags WindowItemStatusFlags; + ImGuiItemStatusFlags ChildItemStatusFlags; // Local parameters stacks // 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.