From 067605052df780a91b0356f28dd918e0d21d6dcf Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 19 Nov 2017 00:11:18 +0100 Subject: [PATCH] Fix IsItemHovered() returning true for non-title bar hidden items that are clipped due to window collapsing logic. Fix 27fd1b913b7cbf1eafdffe6a6539a21776171cdf. (#823) --- imgui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 6fe790131..3c9bf7dd3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2009,6 +2009,9 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) return false; if (window->DC.ItemFlags & ImGuiItemFlags_Disabled) return false; + // Special handling for the 1st item after Begin() which represent the title bar. When the window is collapsed (SkipItems==true) that last item will never be overwritten. + if (window->DC.LastItemId == window->MoveId && window->WriteAccessed) + return false; return true; }