From 0e3c9e4bf88d573bf59b6d834ceb2bafb0a1abc0 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Sat, 20 Dec 2025 16:09:32 -0300 Subject: [PATCH] Make focus visibility when renaming in the scene/file dock consistent --- editor/docks/filesystem_dock.cpp | 1 + editor/docks/scene_tree_dock.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/docks/filesystem_dock.cpp b/editor/docks/filesystem_dock.cpp index fe945c187f..622fe5d62e 100644 --- a/editor/docks/filesystem_dock.cpp +++ b/editor/docks/filesystem_dock.cpp @@ -2517,6 +2517,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected to_move.push_back(to_rename); if (tree->has_focus()) { + tree->grab_focus(!tree->has_focus(true)); // Edit node in Tree. tree->edit_selected(true); diff --git a/editor/docks/scene_tree_dock.cpp b/editor/docks/scene_tree_dock.cpp index 722501a9b8..cf588c77aa 100644 --- a/editor/docks/scene_tree_dock.cpp +++ b/editor/docks/scene_tree_dock.cpp @@ -610,7 +610,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!_validate_no_foreign()) { break; } - tree->grab_focus(); + tree->grab_focus(!tree->has_focus(true)); tree->edit_selected(); } } break; @@ -3836,6 +3836,8 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { const List selection = editor_selection->get_top_selected_node_list(); List full_selection = editor_selection->get_full_selected_node_list(); // Above method only returns nodes with common parent. + scene_tree->get_scene_tree()->grab_focus(true); + if (selection.is_empty()) { if (!profile_allow_editing) { return;