MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / IsWindowFocused

Method IsWindowFocused

plugins/Cardinal/src/DearImGui/imgui.cpp:7005–7025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7003}
7004
7005bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags)
7006{
7007 ImGuiContext& g = *GImGui;
7008 ImGuiWindow* ref_window = g.NavWindow;
7009 ImGuiWindow* cur_window = g.CurrentWindow;
7010
7011 if (ref_window == NULL)
7012 return false;
7013 if (flags & ImGuiFocusedFlags_AnyWindow)
7014 return true;
7015
7016 IM_ASSERT(cur_window); // Not inside a Begin()/End()
7017 const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0;
7018 if (flags & ImGuiHoveredFlags_RootWindow)
7019 cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
7020
7021 if (flags & ImGuiHoveredFlags_ChildWindows)
7022 return IsWindowChildOf(ref_window, cur_window, popup_hierarchy);
7023 else
7024 return (ref_window == cur_window);
7025}
7026
7027// Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext)
7028// 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