Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Race condition in ImGui event code #24

Open
Nemirtingas opened this issue May 26, 2024 · 2 comments
Open

[Windows] Race condition in ImGui event code #24

Nemirtingas opened this issue May 26, 2024 · 2 comments

Comments

@Nemirtingas
Copy link
Owner

Nemirtingas commented May 26, 2024

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)

g.InputEventsQueue is updated in both functions.

@Nemirtingas
Copy link
Owner Author

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.

@Nemirtingas
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant