-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Mouse button stops working when GLFW window regains focus #4984
Comments
I tried to completely disable |
I found the commit that introduced the issue: 200a8f1 |
Hello, |
Tracking After refocusing, every time the mouse button is pressed, The problem goes deeper than Normal notification events, when moving the cursor in & out:
Spurious notification events, generated on every mouse button down only after the window lost and regained focus by clicking into it:
I traced also with Xfce is on a separate computer in a VM and the spurious notifications don't appear, which makes sense, because there's no problem there. I guess that the only thing that ImGui could do is a workaround. |
How does it behave with the SDL backend? The thing is that those spurious "leave / enter" should in theory have no effect on behavior, so going to investigate that by simulating is on other backend... |
I pushed a workaround to handle this: 732bc20 I think this issue might be worth reported to GLFW. |
The commit fixes the issue here. Thanks ! |
…itted by X11/GLFW combo. (ocornut#4984)
Version/Branch of Dear ImGui:
Version:
1.87 WIP
Branch:
master
Back-end/Renderer/Compiler/OS
Problem verified under IceWM in Debian 11. Not an issue with Xfce.
My Issue/Question:
The mouse button stops working when the window loses focus and gets back focus by clicking inside.
Steps for the issue:
example_glfw_opengl2
This is not an issue when the window is minimized & restored.
I think that the problem is that when clicking back into the example window,
io.AddMouseButtonEvent()
in ImGui_ImplGlfw_MouseButtonCallback() is called beforeio.AppFocusLost
is updated in https://github.com/ocornut/imgui/blob/master/imgui.cpp#L7868Losing focus and taking it back by doing minimization & restore, is not a problem because in that case
io.AppFocusLost
is updated before there's any mouse clicking event, like I guess it should be.Unfortunately I don't understand ImGui's internals, so I'm not able to easily fix this myself. Perhaps it's an obvious fix for those with more experience. Thanks.
Standalone, minimal, complete and verifiable example:
Unmodified
example_glfw_opengl2
The text was updated successfully, but these errors were encountered: