| 7395 | } |
| 7396 | |
| 7397 | bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags) |
| 7398 | { |
| 7399 | ImGuiContext& g = *GImGui; |
| 7400 | ImGuiWindow* ref_window = g.NavWindow; |
| 7401 | ImGuiWindow* cur_window = g.CurrentWindow; |
| 7402 | |
| 7403 | if (ref_window == NULL) |
| 7404 | return false; |
| 7405 | if (flags & ImGuiFocusedFlags_AnyWindow) |
| 7406 | return true; |
| 7407 | |
| 7408 | IM_ASSERT(cur_window); // Not inside a Begin()/End() |
| 7409 | const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0; |
| 7410 | if (flags & ImGuiHoveredFlags_RootWindow) |
| 7411 | cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy); |
| 7412 | |
| 7413 | if (flags & ImGuiHoveredFlags_ChildWindows) |
| 7414 | return IsWindowChildOf(ref_window, cur_window, popup_hierarchy); |
| 7415 | else |
| 7416 | return (ref_window == cur_window); |
| 7417 | } |
| 7418 | |
| 7419 | // Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext) |
| 7420 | // Note that NoNavFocus makes the window not reachable with CTRL+TAB but it can still be focused with mouse or programmatically. |
nothing calls this directly
no test coverage detected