MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / AddFocusEvent

Method AddFocusEvent

imgui_tiny_app/imgui/imgui.cpp:2052–2068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2050}
2051
2052void ImGuiIO::AddFocusEvent(bool focused)
2053{
2054 IM_ASSERT(Ctx != NULL);
2055 ImGuiContext& g = *Ctx;
2056
2057 // Filter duplicate
2058 const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_Focus);
2059 const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost;
2060 if (latest_focused == focused || (ConfigDebugIgnoreFocusLoss && !focused))
2061 return;
2062
2063 ImGuiInputEvent e;
2064 e.Type = ImGuiInputEventType_Focus;
2065 e.EventId = g.InputEventsNextEventId++;
2066 e.AppFocused.Focused = focused;
2067 g.InputEventsQueue.push_back(e);
2068}
2069
2070ImGuiPlatformIO::ImGuiPlatformIO()
2071{

Callers 1

Calls 2

FindLatestInputEventFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected