MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / AddFocusEvent

Method AddFocusEvent

extern/imgui/imgui.cpp:1542–1557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1540}
1541
1542void ImGuiIO::AddFocusEvent(bool focused)
1543{
1544 ImGuiContext& g = *GImGui;
1545 IM_ASSERT(&g.IO == this && "Can only add events to current context.");
1546
1547 // Filter duplicate
1548 const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Focus);
1549 const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost;
1550 if (latest_focused == focused)
1551 return;
1552
1553 ImGuiInputEvent e;
1554 e.Type = ImGuiInputEventType_Focus;
1555 e.AppFocused.Focused = focused;
1556 g.InputEventsQueue.push_back(e);
1557}
1558
1559//-----------------------------------------------------------------------------
1560// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)

Callers 1

Calls 2

FindLatestInputEventFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected