-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
macOS apple_openGl example not owning mouse clicks. #2664
Comments
Couldn't add labels. |
Mouse clicks are marked “owned” when the click happens over an imgui window and not over the “void” behind imgui windows. Perhaps your mouse position is not correct for some reason? I assume you are using imgui_impl_osx there (there’s a typo in your template above so i am not sure), which is known to be a bit experimental/faulty mainly because people aren’t looking at it (i don’t own a mac). It’s almost always preferable to use a cross platform backend (glfw, sdl). |
Of course no one cares about the void area. All the demo GUI buttons and such are totally unresponsive. I'm not going to pursue this on mac any longer. I didn't realize that the mac build was exclusively created by "the community". Yes, using imgui_impl_osx. |
Are you using a mouse as you implied, or a touchpad? If the later your issue is probably the same discussed here |
If your issue is for a touchpad, it is a trivial 3-4 lines fix which you can borrow from the impl_glfw logic as mentioned in that thread. OP of that thread wasn’t interested in making a PR with and insisted on a larger api-breaking change so this got stalled but hopefully we could put the easy fix if someones test it. |
Tested with touchpad, magic mouse, and a regular old plugin usb mouse. None of them cause the GUI to register mouse clicks. I'll check out that issue and see if I can implement it. |
I don't follow the logic for the quick fix method from your reply in #1992: Take the first few lines from ImGui_ImplGlfw_UpdateMousePosAndButtons(),
And shove them somewhere "in the beginning of imgui_impl_osx.mm"? Presumably, ImGui_ImplOSX_UpdateMouseCursor()? I must be missing something, because that bit of code doesn't go in well because g_MouseJustPressed is used in a callback method in ImGui_ImplGlfw_MouseButtonCallback() of imgui_impl_glfw.cpp. |
Hello @josht000 , There was a fix of the |
IT WORKS! I think there may be an unrelated issue to how the apple touch pad and imgui is handling 'taps' vs 'clicks', because it's only getting 'taps' every so often. But yes, clicks are working and the windows are now responsive. Thank you @intonarumori and @ocornut |
Well that's great news, thanks indeed to @intonarumori for pointing out that this was the issue, while I was looking completely somewhere else. Sorry for orienting out in the wrong direction there! |
Version/Branch of Dear ImGui:
Version: v1.71
Branches: master and docking
Back-ends: imgui_impl_opengl2.cpp + imgui_impl_opengl2.cpp
Compiler: xcode v9.2 (latest available for a 2016 macbook pro)
Operating System: macOS v10.12.6
Build: Release and Debug
My Issue/Question:
Hey Omar, we chatted on twitter earlier today. Anyway, example_apple_opengl2 isn't handling any mouse clicks. Everything works fine in windows. The main window can be resized, but no clicks are ever handled by the GUI.
Spent several hours debugging and can't find anything conclusive.
While debugging I set breakpoints in UpdateMouseInputs(), clicked the GUI and verified:
Debugging UpdateHoveredWindowAndCaptureFlags(), I verified:
I'm not sure about the deep logic of mouse hovering. Do you have a mac to debug with and provide guidance?
Since this is concerning the example that I know you're familiar with I didn't include any of the source.
Thanks for all that you do!
Josh
The text was updated successfully, but these errors were encountered: