| 3452 | } |
| 3453 | |
| 3454 | static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags) |
| 3455 | { |
| 3456 | // An active popup disable hovering on other windows (apart from its own children) |
| 3457 | // FIXME-OPT: This could be cached/stored within the window. |
| 3458 | ImGuiContext& g = *GImGui; |
| 3459 | if (g.NavWindow) |
| 3460 | if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindowDockTree) |
| 3461 | if (focused_root_window->WasActive && focused_root_window != window->RootWindowDockTree) |
| 3462 | { |
| 3463 | // For the purpose of those flags we differentiate "standard popup" from "modal popup" |
| 3464 | // NB: The order of those two tests is important because Modal windows are also Popups. |
| 3465 | if (focused_root_window->Flags & ImGuiWindowFlags_Modal) |
| 3466 | return false; |
| 3467 | if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup)) |
| 3468 | return false; |
| 3469 | } |
| 3470 | |
| 3471 | // Filter by viewport |
| 3472 | if (window->Viewport != g.MouseViewport) |
| 3473 | if (g.MovingWindow == NULL || window->RootWindowDockTree != g.MovingWindow->RootWindowDockTree) |
| 3474 | return false; |
| 3475 | |
| 3476 | return true; |
| 3477 | } |
| 3478 | |
| 3479 | // This is roughly matching the behavior of internal-facing ItemHoverable() |
| 3480 | // - 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