Backends: SDL2: on iOS, call SDL_StartTextInput()/SDL_StopTextInput() again. (#7636, #9474, #9617)

This commit is contained in:
Pascal Thomet 2026-11-09 17:27:21 +01:00 committed by ocornut
parent 8ba9eb061f
commit c9a52f48e9
2 changed files with 10 additions and 6 deletions

View File

@ -21,8 +21,9 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-11-09: Inputs: iOS: restore SDL_StartTextInput()/SDL_StopTextInput() in IME handler for on-screen keyboard support. (#7636, #9474, #9617)
// 2026-08-06: Fixed querying framebuffer scale when using Metal. (#5592)
// 2026-07-15: Inputs: restore SDL_StartTextInput()/SDL_StopTextInput() in IME handler for on-screen keyboard support on Android/mobile. (#7636, #9474)
// 2026-07-15: Inputs: Android: restore SDL_StartTextInput()/SDL_StopTextInput() in IME handler for on-screen keyboard support. (#7636, #9474)
// 2026-04-16: Made ImGui_ImplSDL2_GetContentScaleForWindow(), ImGui_ImplSDL2_GetContentScaleForDisplay() helpers return a minimum of 1.0f, as some Linux setup seems to report <1.0f value and this breaks scaling border size. (#9369)
// 2026-02-13: Inputs: systems other than X11 are back to starting mouse capture on mouse down (reverts 2025-02-26 change). Only X11 requires waiting for a drag by default (not ideal, but a better default for X11 users). Added ImGui_ImplSDL2_SetMouseCaptureMode() for X11 debugger users. (#3650, #6410, #9235)
// 2026-01-15: Changed GetClipboardText() handler to return nullptr on error aka clipboard contents is not text. Consistent with other backends. (#9168)
@ -216,15 +217,15 @@ static void ImGui_ImplSDL2_PlatformSetImeData(ImGuiContext*, ImGuiViewport*, ImG
r.h = (int)data->InputLineHeight;
SDL_SetTextInputRect(&r);
#ifdef __ANDROID__
// SDL_StartTextInput() is needed on Android (and some other platforms) to show the on-screen keyboard. (#7636, #9474, #6306)
#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
// SDL_StartTextInput() is needed on Android and iOS to show the on-screen keyboard. (#7636, #9474, #6306)
// It was removed in a7703fe6 due to concerns about its relation to desktop IME, but is required on mobile.
SDL_StartTextInput();
#endif
}
else
{
#ifdef __ANDROID__
#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
SDL_StopTextInput();
#endif
}

View File

@ -114,8 +114,11 @@ Other Changes:
- Examples: added support for ARM64 in selected build_win.bat helpers. (#9593) [@Harishmcw]
- Backends:
- GLFW, SDL2: Emscripten implementation of `Platform_OpenInShellFn` calls
`window.open()` with `noopener`: prevents newly opened tab from keeping a
reference to opening page. (#9615, #7660, #7851) [@pthom]
`window.open()` with `noopener`: prevents newly opened tab from keeping a
reference to opening page. (#9615, #7660, #7851) [@pthom]
- SDL2: on iOS, also restore calling `SDL_StartTextInput()/SDL_StopTextInput()`
in IME handler. Match Android change in 1.93.0. [@pthom] (#7636, #9474, #9617)
-----------------------------------------------------------------------