mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Backends: SDL3: Fixed an issue with missing characters events when an already active text field changes viewports. (#9054)
Always use SDL_GetKeyboardFocus(). (tried to defer ImGui_ImplSDL3_PlatformSetImeData() processing for when OS-window is available but it didn't actually work because we don't systemetically OS-focus new viewports and SDL3 only sent characters to keyboard focused window.)
This commit is contained in:
parent
1897248bda
commit
e674f57bb6
3 changed files with 35 additions and 11 deletions
|
|
@ -5870,9 +5870,9 @@ void ImGui::EndFrame()
|
|||
ImGuiPlatformImeData* ime_data = &g.PlatformImeData;
|
||||
if (g.PlatformIO.Platform_SetImeDataFn != NULL && memcmp(ime_data, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0)
|
||||
{
|
||||
IMGUI_DEBUG_LOG_IO("[io] Calling Platform_SetImeDataFn(): WantVisible: %d, InputPos (%.2f,%.2f)\n", ime_data->WantVisible, ime_data->InputPos.x, ime_data->InputPos.y);
|
||||
IM_ASSERT(ime_data->ViewportId == IMGUI_VIEWPORT_DEFAULT_ID); // master branch
|
||||
ImGuiViewport* viewport = GetMainViewport();
|
||||
IMGUI_DEBUG_LOG_IO("[io] Calling Platform_SetImeDataFn(): WantVisible: %d, InputPos (%.2f,%.2f) for Viewport 0x%08X\n", ime_data->WantVisible, ime_data->InputPos.x, ime_data->InputPos.y, viewport->ID);
|
||||
g.PlatformIO.Platform_SetImeDataFn(&g, viewport, ime_data);
|
||||
}
|
||||
g.WantTextInputNextFrame = ime_data->WantTextInput ? 1 : 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue