MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / IsWindowContentHoverable

Method IsWindowContentHoverable

imgui_tiny_app/imgui/imgui.cpp:4878–4907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4876}
4877
4878bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
4879{
4880 // An active popup disable hovering on other windows (apart from its own children)
4881 // FIXME-OPT: This could be cached/stored within the window.
4882 ImGuiContext& g = *GImGui;
4883 if (g.NavWindow)
4884 if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindowDockTree)
4885 if (focused_root_window->WasActive && focused_root_window != window->RootWindowDockTree)
4886 {
4887 // For the purpose of those flags we differentiate "standard popup" from "modal popup"
4888 // NB: The 'else' is important because Modal windows are also Popups.
4889 bool want_inhibit = false;
4890 if (focused_root_window->Flags & ImGuiWindowFlags_Modal)
4891 want_inhibit = true;
4892 else if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup))
4893 want_inhibit = true;
4894
4895 // Inhibit hover unless the window is within the stack of our modal/popup
4896 if (want_inhibit)
4897 if (!IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window))
4898 return false;
4899 }
4900
4901 // Filter by viewport
4902 if (window->Viewport != g.MouseViewport)
4903 if (g.MovingWindow == NULL || window->RootWindowDockTree != g.MovingWindow->RootWindowDockTree)
4904 return false;
4905
4906 return true;
4907}
4908
4909static inline float CalcDelayFromHoveredFlags(ImGuiHoveredFlags flags)
4910{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected