Update IME text only for focused input controls.

This commit is contained in:
bruvzg 2019-01-08 22:52:56 +02:00
parent bcecf56267
commit 55bc004a73
No known key found for this signature in database
GPG key ID: 89DD917D9CE4218D
2 changed files with 13 additions and 7 deletions

View file

@ -248,7 +248,9 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
set_cursor_position(text.length());
} break;
#endif
default: { handled = false; }
default: {
handled = false;
}
}
if (handled) {
@ -860,9 +862,11 @@ void LineEdit::_notification(int p_what) {
} break;
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
ime_text = OS::get_singleton()->get_ime_text();
ime_selection = OS::get_singleton()->get_ime_selection();
update();
if (has_focus()) {
ime_text = OS::get_singleton()->get_ime_text();
ime_selection = OS::get_singleton()->get_ime_selection();
update();
}
} break;
}
}

View file

@ -1449,9 +1449,11 @@ void TextEdit::_notification(int p_what) {
} break;
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
ime_text = OS::get_singleton()->get_ime_text();
ime_selection = OS::get_singleton()->get_ime_selection();
update();
if (has_focus()) {
ime_text = OS::get_singleton()->get_ime_text();
ime_selection = OS::get_singleton()->get_ime_selection();
update();
}
} break;
}
}