| 1540 | } |
| 1541 | |
| 1542 | void 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) |
no test coverage detected