From 803ac3a5c641d69a879fe290cb5d401677126e2d Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 2 Nov 2017 16:23:03 +0100 Subject: [PATCH] IsWindowHovered() Fix behavior when an item is active to use the same logic as IsItemHovered() (#1382, #1404) --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 9f5f781c..6ef4db0c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5115,7 +5115,7 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) if (!IsWindowContentHoverable(g.HoveredRootWindow, flags)) return false; if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) - if (g.ActiveId != 0 && g.ActiveIdWindow != g.CurrentWindow) + if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap) return false; return true; } @@ -5151,7 +5151,7 @@ bool ImGui::IsRootWindowOrAnyChildHovered(ImGuiHoveredFlags flags) if (!IsWindowContentHoverable(g.HoveredRootWindow, flags)) return false; if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) - if (g.ActiveId != 0 && g.ActiveIdWindow != g.CurrentWindow) + if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap) return false; return true; }