You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
[IME] Do not redraw and move caret on IME update w/o text/position changes.
This commit is contained in:
@@ -1377,8 +1377,14 @@ void LineEdit::_notification(int p_what) {
|
|||||||
|
|
||||||
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
|
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
|
||||||
if (editing) {
|
if (editing) {
|
||||||
ime_text = DisplayServer::get_singleton()->ime_get_text();
|
const String &new_ime_text = DisplayServer::get_singleton()->ime_get_text();
|
||||||
ime_selection = DisplayServer::get_singleton()->ime_get_selection();
|
const Vector2i &new_ime_selection = DisplayServer::get_singleton()->ime_get_selection();
|
||||||
|
if (ime_text == new_ime_text && ime_selection == new_ime_selection) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ime_text = new_ime_text;
|
||||||
|
ime_selection = new_ime_selection;
|
||||||
|
|
||||||
if (!ime_text.is_empty()) {
|
if (!ime_text.is_empty()) {
|
||||||
selection_delete();
|
selection_delete();
|
||||||
|
|||||||
@@ -1633,9 +1633,15 @@ void TextEdit::_notification(int p_what) {
|
|||||||
|
|
||||||
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
|
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
|
||||||
if (has_focus()) {
|
if (has_focus()) {
|
||||||
|
const String &new_ime_text = DisplayServer::get_singleton()->ime_get_text();
|
||||||
|
const Vector2i &new_ime_selection = DisplayServer::get_singleton()->ime_get_selection();
|
||||||
|
if (ime_text == new_ime_text && ime_selection == new_ime_selection) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
bool had_ime_text = has_ime_text();
|
bool had_ime_text = has_ime_text();
|
||||||
ime_text = DisplayServer::get_singleton()->ime_get_text();
|
ime_text = new_ime_text;
|
||||||
ime_selection = DisplayServer::get_singleton()->ime_get_selection();
|
ime_selection = new_ime_selection;
|
||||||
|
|
||||||
if (!had_ime_text && has_ime_text()) {
|
if (!had_ime_text && has_ime_text()) {
|
||||||
_cancel_drag_and_drop_text();
|
_cancel_drag_and_drop_text();
|
||||||
|
|||||||
Reference in New Issue
Block a user