From 7f38773b738e8d37b1a3c1d627205821300ef765 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 17 Nov 2021 12:45:33 +0100 Subject: [PATCH] Fixed crash on right-click without modal, introduced by previous commit a3667f46, (#4729) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 87c2bbfe..3663a46f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3831,7 +3831,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame() // Find the top-most window between HoveredWindow and the top-most Modal Window. // This is where we can trim the popup stack. ImGuiWindow* modal = GetTopMostPopupModal(); - bool hovered_window_above_modal = g.HoveredWindow && IsWindowAbove(g.HoveredWindow, modal); + bool hovered_window_above_modal = g.HoveredWindow && (modal == NULL || IsWindowAbove(g.HoveredWindow, modal)); ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true); } }