From ca46e5d959c13a6211da976e9a4ef86a7540a169 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 8 Jan 2026 14:41:17 +0100 Subject: [PATCH] Backends: SDL2/SDL3: adjusted IME offset to match other backends and master branch. (#6071, #1953) Amend 1668693bc --- backends/imgui_impl_sdl2.cpp | 2 +- backends/imgui_impl_sdl3.cpp | 2 +- docs/CHANGELOG.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_sdl2.cpp b/backends/imgui_impl_sdl2.cpp index f0b8b2bb4..1605d672d 100644 --- a/backends/imgui_impl_sdl2.cpp +++ b/backends/imgui_impl_sdl2.cpp @@ -219,7 +219,7 @@ static void ImGui_ImplSDL2_PlatformSetImeData(ImGuiContext*, ImGuiViewport* view { SDL_Rect r; r.x = (int)(data->InputPos.x - viewport->Pos.x); - r.y = (int)(data->InputPos.y - viewport->Pos.y + data->InputLineHeight); + r.y = (int)(data->InputPos.y - viewport->Pos.y); r.w = 1; r.h = (int)data->InputLineHeight; SDL_SetTextInputRect(&r); diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp index 3f60ce4a8..da2257e56 100644 --- a/backends/imgui_impl_sdl3.cpp +++ b/backends/imgui_impl_sdl3.cpp @@ -214,7 +214,7 @@ static void ImGui_ImplSDL3_UpdateIme() viewport_pos = viewport->Pos; SDL_Rect r; r.x = (int)(data->InputPos.x - viewport_pos.x); - r.y = (int)(data->InputPos.y - viewport_pos.y + data->InputLineHeight); + r.y = (int)(data->InputPos.y - viewport_pos.y); r.w = 1; r.h = (int)data->InputLineHeight; SDL_SetTextInputArea(window, &r, 0); diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index b121f55b7..dd89c8302 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -185,6 +185,7 @@ Docking+Viewports Branch: gamepad/keyboard to move a window to another viewport. (#9053) [@lut0pia, @ocornut] - Fixed implicit/fallback "Debug" window from staying visible if once docked. (#9151) - Backends: + - SDL2, SDL3: adjust IME offset to match other backends and master branch. (#6071, #1953) - Win32: viewports created by backend forcefully direct messages to DefWindowProcW() in order to support Unicode text input. (#9099, #3653, #5961) [@ulhc]