Fix IME position in the single window mode sub-windows.
This commit is contained in:
parent
ad9302bafc
commit
3ca3ee36ab
2 changed files with 20 additions and 6 deletions
|
@ -1068,8 +1068,11 @@ void LineEdit::_notification(int p_what) {
|
||||||
if (has_focus()) {
|
if (has_focus()) {
|
||||||
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
||||||
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
||||||
Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2);
|
Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2) + get_global_position();
|
||||||
DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + pos, get_viewport()->get_window_id());
|
if (get_window()->get_embedder()) {
|
||||||
|
pos += get_viewport()->get_popup_base_transform().get_origin();
|
||||||
|
}
|
||||||
|
DisplayServer::get_singleton()->window_set_ime_position(pos, get_viewport()->get_window_id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -1088,8 +1091,11 @@ void LineEdit::_notification(int p_what) {
|
||||||
|
|
||||||
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
||||||
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
||||||
Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2);
|
Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2) + get_global_position();
|
||||||
DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + pos, get_viewport()->get_window_id());
|
if (get_window()->get_embedder()) {
|
||||||
|
pos += get_viewport()->get_popup_base_transform().get_origin();
|
||||||
|
}
|
||||||
|
DisplayServer::get_singleton()->window_set_ime_position(pos, get_viewport()->get_window_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
show_virtual_keyboard();
|
show_virtual_keyboard();
|
||||||
|
|
|
@ -1480,7 +1480,11 @@ void TextEdit::_notification(int p_what) {
|
||||||
if (has_focus()) {
|
if (has_focus()) {
|
||||||
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
||||||
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
||||||
DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + get_caret_draw_pos(), get_viewport()->get_window_id());
|
Point2 pos = get_global_position() + get_caret_draw_pos();
|
||||||
|
if (get_window()->get_embedder()) {
|
||||||
|
pos += get_viewport()->get_popup_base_transform().get_origin();
|
||||||
|
}
|
||||||
|
DisplayServer::get_singleton()->window_set_ime_position(pos, get_viewport()->get_window_id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -1494,7 +1498,11 @@ void TextEdit::_notification(int p_what) {
|
||||||
|
|
||||||
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
|
||||||
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id());
|
||||||
DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + get_caret_draw_pos(), get_viewport()->get_window_id());
|
Point2 pos = get_global_position() + get_caret_draw_pos();
|
||||||
|
if (get_window()->get_embedder()) {
|
||||||
|
pos += get_viewport()->get_popup_base_transform().get_origin();
|
||||||
|
}
|
||||||
|
DisplayServer::get_singleton()->window_set_ime_position(pos, get_viewport()->get_window_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
|
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
|
||||||
|
|
Loading…
Reference in a new issue