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

imgui_impl_osx.mm: import the glfw workaround to avoid missing mouse clicks. #3261

Closed
wants to merge 1 commit into from

Conversation

nburrus
Copy link
Contributor

@nburrus nburrus commented May 25, 2020

This PR addresses the "missing clicks" issue on mac, which happens very easily with the trackpad when using the soft click feature (it generates very quick Press/Release events that often do not span over two frames).

It was also reported in #1992 . The ideal solution requires a refactoring to add event queues, but a simple workaround was suggested by just following the GLFW example, this is the approach I took here. It is slightly different because it does not rely on an API call to get the instant mouse state, but instead maintains the freshest mouseDown state locally with g_MouseDown, and only forwards it to ImGuiIO when there was no press during that same frame.

I found that another more general fix was proposed in #2525 , but since there is already an event queue design in the pipe, it might make sense to just merge the quick fix for macOS for now?

@ocornut
Copy link
Owner

ocornut commented May 25, 2020

YES PLEASE! Thanks for doing this and submitting a detailed issue with references. Pushed with very minor tweaks.

@ocornut ocornut closed this May 25, 2020
rokups pushed a commit to rokups/imgui that referenced this pull request May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants