MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / IsWindowContentHoverable

Function IsWindowContentHoverable

core/src/imgui/imgui.cpp:3127–3144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3125}
3126
3127static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
3128{
3129 // An active popup disable hovering on other windows (apart from its own children)
3130 // FIXME-OPT: This could be cached/stored within the window.
3131 ImGuiContext& g = *GImGui;
3132 if (g.NavWindow)
3133 if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindow)
3134 if (focused_root_window->WasActive && focused_root_window != window->RootWindow)
3135 {
3136 // For the purpose of those flags we differentiate "standard popup" from "modal popup"
3137 // NB: The order of those two tests is important because Modal windows are also Popups.
3138 if (focused_root_window->Flags & ImGuiWindowFlags_Modal)
3139 return false;
3140 if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup))
3141 return false;
3142 }
3143 return true;
3144}
3145
3146// This is roughly matching the behavior of internal-facing ItemHoverable()
3147// - 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