From 76d782d2912374a8bb71de9312f7b8ffc7743cb9 Mon Sep 17 00:00:00 2001 From: Marwen Azouzi Date: Wed, 11 Jun 2025 17:43:21 +0200 Subject: [PATCH] Fix IME window position not taking into account window transform --- scene/gui/line_edit.cpp | 2 ++ scene/gui/text_edit.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 91a5623527..866b8dc244 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -132,6 +132,8 @@ void LineEdit::_update_ime_window_position() { if (get_window()->get_embedder()) { pos += get_viewport()->get_popup_base_transform().get_origin(); } + // Take into account the window's transform. + pos = get_window()->get_screen_transform().xform(pos); // The window will move to the updated position the next time the IME is updated, not immediately. DisplayServer::get_singleton()->window_set_ime_position(pos, wid); } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 38d2a851b6..23c7452243 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3427,6 +3427,8 @@ void TextEdit::_update_ime_window_position() { if (get_window()->get_embedder()) { pos += get_viewport()->get_popup_base_transform().get_origin(); } + // Take into account the window's transform. + pos = get_window()->get_screen_transform().xform(pos); // The window will move to the updated position the next time the IME is updated, not immediately. DisplayServer::get_singleton()->window_set_ime_position(pos, wid); }