Fix docks grabbing too much focus

This commit is contained in:
Logan Detrick
2025-12-20 15:15:05 -08:00
parent 551ce8d47f
commit 0e072e9014
4 changed files with 16 additions and 8 deletions

View File

@@ -844,6 +844,19 @@ void EditorDockManager::open_dock(EditorDock *p_dock, bool p_set_current) {
ERR_FAIL_COND_MSG(!all_docks.has(p_dock), vformat("Cannot open unknown dock '%s'.", p_dock->get_display_title()));
if (p_dock->is_open) {
// Show the dock if it is already open.
if (p_set_current) {
if (p_dock->dock_window) {
p_dock->get_window()->grab_focus();
return;
}
TabContainer *dock_tab_container = get_dock_tab_container(p_dock);
if (dock_tab_container) {
int tab_index = dock_tab_container->get_tab_idx_from_control(p_dock);
dock_tab_container->set_current_tab(tab_index);
}
}
return;
}