Platform IME: added ImGuiPlatformImeData::WantTextInput, ViewportId. Backends: SDL3: honor WantTextInput. (#8584, #7492, #6341)

This commit is contained in:
ocornut
2025-04-22 11:21:02 +02:00
parent af987eb117
commit bf0f586b69
6 changed files with 27 additions and 13 deletions

View File

@@ -5362,7 +5362,7 @@ void ImGui::NewFrame()
// Platform IME data: reset for the frame
g.PlatformImeDataPrev = g.PlatformImeData;
g.PlatformImeData.WantVisible = false;
g.PlatformImeData.WantVisible = g.PlatformImeData.WantTextInput = false;
// Mouse wheel scrolling, scale
UpdateMouseWheel();
@@ -5654,9 +5654,11 @@ void ImGui::EndFrame()
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();
g.PlatformIO.Platform_SetImeDataFn(&g, viewport, ime_data);
}
g.WantTextInputNextFrame = ime_data->WantTextInput ? 1 : 0;
// Hide implicit/fallback "Debug" window if it hasn't been used
g.WithinFrameScopeWithImplicitWindow = false;