MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / IsWindowContentHoverable

Function IsWindowContentHoverable

plugins/Cardinal/src/DearImGui/imgui.cpp:3256–3273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3254}
3255
3256static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
3257{
3258 // An active popup disable hovering on other windows (apart from its own children)
3259 // FIXME-OPT: This could be cached/stored within the window.
3260 ImGuiContext& g = *GImGui;
3261 if (g.NavWindow)
3262 if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindow)
3263 if (focused_root_window->WasActive && focused_root_window != window->RootWindow)
3264 {
3265 // For the purpose of those flags we differentiate "standard popup" from "modal popup"
3266 // NB: The order of those two tests is important because Modal windows are also Popups.
3267 if (focused_root_window->Flags & ImGuiWindowFlags_Modal)
3268 return false;
3269 if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup))
3270 return false;
3271 }
3272 return true;
3273}
3274
3275// This is roughly matching the behavior of internal-facing ItemHoverable()
3276// - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered()

Callers 3

IsItemHoveredMethod · 0.85
ItemHoverableMethod · 0.85
IsWindowHoveredMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected