From 81fa4a4268d50dc3f1f637f9470c950dd799d95e Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 12 Jun 2022 13:03:01 +0800 Subject: [PATCH] Fix scene tree dock focus after using "Add Child Node" button (cherry picked from commit 512b70858c75e84b88272cf7abef282dc0be79b5) --- editor/scene_tree_dock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index f21d78205e9..d7a1dd8cd4a 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2297,7 +2297,7 @@ void SceneTreeDock::_create() { _do_reparent(last_created, -1, nodes, true); } - scene_tree->get_scene_tree()->grab_focus(); + scene_tree->get_scene_tree()->call_deferred("grab_focus"); } void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_properties, bool p_remove_old) {