diff --git a/imgui.cpp b/imgui.cpp index 9a4c016cc..4e914f06f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4158,7 +4158,6 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas) PlatformImeData.InputPos = ImVec2(0.0f, 0.0f); PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission - PlatformImeViewport = 0; DockNodeWindowMenuHandler = NULL; @@ -5898,7 +5897,7 @@ void ImGui::EndFrame() ImGuiPlatformImeData* ime_data = &g.PlatformImeData; if (g.PlatformIO.Platform_SetImeDataFn != NULL && memcmp(ime_data, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0) { - ImGuiViewport* viewport = FindViewportByID(g.PlatformImeViewport); + ImGuiViewport* viewport = FindViewportByID(ime_data->ViewportId); 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); if (viewport == NULL) viewport = GetMainViewport(); diff --git a/imgui_internal.h b/imgui_internal.h index 4d28f0e44..7d67f541a 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -2568,7 +2568,6 @@ struct ImGuiContext // Platform support ImGuiPlatformImeData PlatformImeData; // Data updated by current frame. Will be applied at end of the frame. For some backends, this is required to have WantVisible=true in order to receive text message. ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data. When changed we call the platform_io.Platform_SetImeDataFn() handler. - ImGuiID PlatformImeViewport; // Extensions // FIXME: We could provide an API to register one slot in an array held in ImGuiContext?