-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Android: button rendered as clicked after being released #6627
Comments
try in init
in my opinion this is not a pressed state, but just a cursor over the button |
No change unfortunately. In both types of initialization (with/without your suggestion) input event handler (android_app* app->onInputEvent) is called twice upon button press. Inspecting those two events further down imgui impl: event 1: event 2: So looks like the control logic works well, the rendering however does not follow. |
It’s not a rendering issue it is that the backend should submit a mouse leaving (AddMousePosEvent(-FLT_MAX,-FLT_MAX)) invalid position) event after the touch release. We haven’t formalized that design accross backends. It would also prevent certain actions such as long hovering for tooltips from happening. |
Thanks for info @ocornut. Will try to add triggering of that event after event 2 described above. In my case tooltips are not required, so that should not be a problem. |
@ocornut your suggestion worked fine for me, thank you for that. |
This issue is likely to affect all users trying to use ImGui on Android. The tooltips are not used much in Android so it would be nice to see this resolved. |
Main problem is i don’t know how to build/test the Android backend at this point. Passing me instructions how to do that with eg an emulator would probably help its maintenance. |
I use Android Studio and it works painlessly most of the time. I am attaching a short guide for it. |
Version/Branch of Dear ImGui:
Version: 1.87
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_android.cpp
Compiler: Android NDK/clang
Operating System: Android 13
My Issue/Question:
On Android, after clicking a button it stays rendered as in active/pressed state. It is getting rendered as inactive only after another button/item is clicked.
Standalone, minimal, complete and verifiable example:
Build and run android sample shipped with the library, click the button.
The text was updated successfully, but these errors were encountered: