Fixed crash on right-click without modal, introduced by previous commit a3667f46, (#4729)

This commit is contained in:
ocornut 2021-11-17 12:45:33 +01:00
parent a3667f462a
commit 764f9e606d

View File

@ -3712,7 +3712,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
// Find the top-most window between HoveredWindow and the top-most Modal Window. // Find the top-most window between HoveredWindow and the top-most Modal Window.
// This is where we can trim the popup stack. // This is where we can trim the popup stack.
ImGuiWindow* modal = GetTopMostPopupModal(); 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); ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true);
} }
} }