MCPcopy Create free account
hub / github.com/RenderKit/embree / IsWindowFocused

Method IsWindowFocused

tutorials/common/imgui/imgui.cpp:7397–7417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7395}
7396
7397bool 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.

Callers

nothing calls this directly

Calls 1

GetCombinedRootWindowFunction · 0.85

Tested by

no test coverage detected