From 58e935b746cb8488962f8185d338f53515133140 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Mon, 5 Sep 2022 22:13:03 -0700 Subject: [PATCH] Disable logic that triggers automatic focus gain as the Godot Editor is loaded For the Godot Android Editor, this is an inconvenience as it causes the soft keyboard to show and block half of the view --- editor/plugins/script_text_editor.cpp | 2 ++ editor/project_manager.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 239ad1fe1..f111b97b0 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -501,7 +501,9 @@ void ScriptTextEditor::set_edit_state(const Variant &p_state) { } if (editor_enabled) { +#ifndef ANDROID_ENABLED ensure_focus(); +#endif } } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 17eafc6fb..03ba0e983 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1792,6 +1792,7 @@ void ProjectManager::_notification(int p_what) { } } break; case NOTIFICATION_READY: { +#ifndef ANDROID_ENABLED if (_project_list->get_project_count() == 0 && StreamPeerSSL::is_available()) { open_templates->popup_centered_minsize(); } @@ -1801,6 +1802,7 @@ void ProjectManager::_notification(int p_what) { // to search without having to reach for their mouse project_filter->search_box->grab_focus(); } +#endif } break; case NOTIFICATION_VISIBILITY_CHANGED: { set_process_unhandled_input(is_visible_in_tree()); @@ -2336,6 +2338,7 @@ void ProjectManager::_on_filter_option_changed() { } void ProjectManager::_on_tab_changed(int p_tab) { +#ifndef ANDROID_ENABLED if (p_tab == 0) { // Projects // Automatically grab focus when the user moves from the Templates tab // back to the Projects tab. @@ -2347,6 +2350,7 @@ void ProjectManager::_on_tab_changed(int p_tab) { // The Templates tab's search field is focused on display in the asset // library editor plugin code. +#endif } void ProjectManager::_bind_methods() {