When a game uses multiple threads for rendering and event, a race condition will occur in ImGui between:
static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1)
and
void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
A fix could be to store ImGui events in the WindowsHook (and eventually X11Hook and NSViewHook) and send the events to ImGui before the call to ImGui_ImplWin32_NewFrame.
When a game uses multiple threads for rendering and event, a race condition will occur in ImGui between:
static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1)
andvoid ImGui::UpdateInputEvents(bool trickle_fast_inputs)
g.InputEventsQueue
is updated in both functions.