From d9f6ba30351cbbff54db2d0169a46bb603611587 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 25 Mar 2019 15:39:11 +0100 Subject: [PATCH] IsWindowHovered() made change which should have no effect in master but fix result of IsWindowHovered(ImGuiHoveredFlags_ChildWindows) over multiple viewport in docking branch. (#2432) --- imgui.cpp | 2 +- imgui_demo.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 434dda47f..41c569364 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6016,7 +6016,7 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) } } - if (!IsWindowContentHoverable(g.HoveredRootWindow, flags)) + if (!IsWindowContentHoverable(g.HoveredWindow, flags)) return false; if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != g.HoveredWindow->MoveId) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index e9e8265b7..37eacfa3b 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1594,6 +1594,7 @@ static void ShowDemoWindowWidgets() "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n" "IsWindowHovered(_ChildWindows) = %d\n" "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n" + "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n" "IsWindowHovered(_RootWindow) = %d\n" "IsWindowHovered(_AnyWindow) = %d\n", ImGui::IsWindowHovered(), @@ -1601,6 +1602,7 @@ static void ShowDemoWindowWidgets() ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow), + ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_AllowWhenBlockedByPopup), ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow), ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow));