mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix crash when revealing file in floating FileSystem Dock
When selecting "Show in FileSystem" from the context menu of a resource
in the inspector, the engine would crash if the FileSystem dock was
floating because it was trying to focus the FileSystem tab, but floating
docks don't use Tab Containers. This commit makes the FileSystem dock's
window grab focus instead if it's floating.
(cherry picked from commit c4d1513e15
)
This commit is contained in:
parent
41f4068a6e
commit
7490f89238
1 changed files with 6 additions and 2 deletions
|
@ -399,8 +399,12 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
||||||
file_system_dock->navigate_to_path(edited_resource->get_path());
|
file_system_dock->navigate_to_path(edited_resource->get_path());
|
||||||
|
|
||||||
// Ensure that the FileSystem dock is visible.
|
// Ensure that the FileSystem dock is visible.
|
||||||
TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control();
|
if (file_system_dock->get_window() == get_tree()->get_root()) {
|
||||||
tab_container->set_current_tab(tab_container->get_tab_idx_from_control(file_system_dock));
|
TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control();
|
||||||
|
tab_container->set_current_tab(tab_container->get_tab_idx_from_control(file_system_dock));
|
||||||
|
} else {
|
||||||
|
file_system_dock->get_window()->grab_focus();
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue