| 3254 | } |
| 3255 | |
| 3256 | static 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() |
no outgoing calls
no test coverage detected