| 2050 | } |
| 2051 | |
| 2052 | void 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 | |
| 2070 | ImGuiPlatformIO::ImGuiPlatformIO() |
| 2071 | { |
no test coverage detected