| 1732 | } |
| 1733 | |
| 1734 | void ImGuiIO::AddFocusEvent(bool focused) |
| 1735 | { |
| 1736 | IM_ASSERT(Ctx != NULL); |
| 1737 | ImGuiContext& g = *Ctx; |
| 1738 | |
| 1739 | // Filter duplicate |
| 1740 | const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_Focus); |
| 1741 | const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost; |
| 1742 | if (latest_focused == focused || (ConfigDebugIgnoreFocusLoss && !focused)) |
| 1743 | return; |
| 1744 | |
| 1745 | ImGuiInputEvent e; |
| 1746 | e.Type = ImGuiInputEventType_Focus; |
| 1747 | e.EventId = g.InputEventsNextEventId++; |
| 1748 | e.AppFocused.Focused = focused; |
| 1749 | g.InputEventsQueue.push_back(e); |
| 1750 | } |
| 1751 | |
| 1752 | //----------------------------------------------------------------------------- |
| 1753 | // [SECTION] MISC HELPERS/UTILITIES (Geometry functions) |
no test coverage detected