imgui: ImGui::InputText freezes in v1.87+ in a Win32 IME ImmAssociateContextEx() call
Version/Branch of Dear ImGui:
Version: v1.88 Branch: https://github.com/Microsoft/vcpkg/blob/master/ports/imgui/portfile.cmake
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp Compiler: MSVC Operating System: Windows 11 Pro
My Issue/Question:
I’m using ImGui::InputText() to create text fields. Since v.187 of Dear ImGui clicking into text fields freezes the entire application (no crash but “stopped responding”). The bug does not occur with v1.86 and the bug still occurs in v1.88.
Standalone, minimal, complete and verifiable example:
std::string input_text;
ImGui::Begin("Example Bug");
ImGui::InputText("My text field", &input_text);
ImGui::End();
I researched but didn’t find a clear solution or workaround (besides downgrading to v1.86). I believe my issue is similar to https://github.com/ocornut/imgui/issues/4972 and https://github.com/ocornut/imgui/issues/5264. How exactly would you debug into ImGui::InputText() getting stuck if needed? ImGui::InputText() takes me to the imgui_stdlib.h file and not the .cpp file and input texts are probably handled somewhere else. What exactly changed between those versions which could cause this regression? Thanks in advance for taking a look into this.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 23 (13 by maintainers)
Commits related to this issue
- Platform IME: Windows: Fixed a call to ImmAssociateContextEx() leading to freeze on some setups. (#2589, #5535, #5264, #4972) + misc comments — committed to ocornut/imgui by ocornut 2 years ago
- Platform IME: Windows: Revert 133bbafa and 29a8ee08 as regression until new results comes. (#2589, #5535, #5264, #4972) — committed to ocornut/imgui by ocornut 2 years ago
- Bugfix: commenting out code triggering a hang since recent ImGUI update My guess is that it's caused by non-main thread invocation of winapi, but I can't test it easily in my app. Waiting on https://... — committed to Dwarfius/VulkanRTSEngine by Dwarfius 2 years ago
- Platform IME: Windows: Fixed a call to ImmAssociateContextEx() leading to freeze on some setups. (#2589, #5535, #5264, #4972) + misc comments — committed to kjblanchard/imgui by ocornut 2 years ago
- Platform IME: Windows: Revert 133bbafa and 29a8ee08 as regression until new results comes. (#2589, #5535, #5264, #4972) — committed to kjblanchard/imgui by ocornut 2 years ago
@ocornut I could reproduce it with a pretty simple hello world example. Now I’m a bit stuck regarding what could still cause this issue. Please take a look at my repository: https://github.com/BullyWiiPlaza/ImGuiFreezingTest I invited you as collaborator, please accept the invite and you can access this private repository. All instructions are provided in the README.
Thanks for the feedback.
Based on the multiple reports and the fact we did make changes to Win32 IME code in 1.87, I am assuming we do have an issue but I would like to understand if it is tied to debugger loading symbols or something else.
If something appears stuck, you first want to break in the debugger to find where.
Answer is in the changelog:
Diffing between 1.86 and 1.87, the important related changes here are that we want from:
to
If you want to help I would need you to very precisely answer the following questions, one by one:
::ImmAssociateContextEx(hwnd, NULL, data->WantVisible ? IACE_DEFAULT : 0);. Does it makes a difference?::ImmSetCandidateWindow(himc, &candidate_form);. Does it makes a difference?Thank you very much!