|
|
|
@ -3436,17 +3436,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 = false;
|
|
|
|
|
if (modal == NULL)
|
|
|
|
|
hovered_window_above_modal = true;
|
|
|
|
|
for (int i = g.Windows.Size - 1; i >= 0 && hovered_window_above_modal == false; i--)
|
|
|
|
|
{
|
|
|
|
|
ImGuiWindow* window = g.Windows[i];
|
|
|
|
|
if (window == modal)
|
|
|
|
|
break;
|
|
|
|
|
if (window == g.HoveredWindow)
|
|
|
|
|
hovered_window_above_modal = true;
|
|
|
|
|
}
|
|
|
|
|
bool hovered_window_above_modal = g.HoveredWindow && IsWindowAbove(g.HoveredWindow, modal);
|
|
|
|
|
ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -6334,6 +6324,20 @@ bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below)
|
|
|
|
|
{
|
|
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
|
for (int i = g.Windows.Size - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
ImGuiWindow* candidate_window = g.Windows[i];
|
|
|
|
|
if (candidate_window == potential_above)
|
|
|
|
|
return true;
|
|
|
|
|
if (candidate_window == potential_below)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
|
|
|
|
|
{
|
|
|
|
|
IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function
|
|
|
|
|