Similar to IsWindowHovered()
| 12786 | |
| 12787 | // Similar to IsWindowHovered() |
| 12788 | bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags) |
| 12789 | { |
| 12790 | ImGuiContext& g = *GImGui; |
| 12791 | ImGuiWindow* ref_window = g.NavWindow; |
| 12792 | ImGuiWindow* cur_window = g.CurrentWindow; |
| 12793 | |
| 12794 | if (ref_window == NULL) |
| 12795 | return false; |
| 12796 | if (flags & ImGuiFocusedFlags_AnyWindow) |
| 12797 | return true; |
| 12798 | |
| 12799 | IM_ASSERT(cur_window); // Not inside a Begin()/End() |
| 12800 | const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0; |
| 12801 | if (flags & ImGuiFocusedFlags_RootWindow) |
| 12802 | cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy); |
| 12803 | |
| 12804 | if (flags & ImGuiFocusedFlags_ChildWindows) |
| 12805 | return IsWindowChildOf(ref_window, cur_window, popup_hierarchy); |
| 12806 | else |
| 12807 | return ref_window == cur_window; |
| 12808 | } |
| 12809 | |
| 12810 | static int ImGui::FindWindowFocusIndex(ImGuiWindow* window) |
| 12811 | { |
nothing calls this directly
no test coverage detected