From 6eac6889520aa901fbff75a744e69c3fada11fdb Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 6 Mar 2019 12:42:01 -0300 Subject: Don't hide/show top editor if they did not change, fixes #26644 --- editor/editor_node.cpp | 16 ++++++++++++++-- editor/plugins/shader_editor_plugin.cpp | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'editor') diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d940a96123..f0c9e87b76 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1454,9 +1454,21 @@ void EditorNode::edit_item(Object *p_object) { } if (!sub_plugins.empty()) { - _display_top_editors(false); - _set_top_editors(sub_plugins); + bool same = true; + if (sub_plugins.size() == editor_plugins_over->get_plugins_list().size()) { + for (int i = 0; i < sub_plugins.size(); i++) { + if (sub_plugins[i] != editor_plugins_over->get_plugins_list()[i]) { + same = false; + } + } + } else { + same = false; + } + if (!same) { + _display_top_editors(false); + _set_top_editors(sub_plugins); + } _set_editing_top_editors(p_object); _display_top_editors(true); } else { diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 033a6c56d9..2b6ceac8e2 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -355,8 +355,8 @@ void ShaderEditor::_menu_option(int p_option) { void ShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (is_visible_in_tree()) - shader_editor->get_text_edit()->grab_focus(); + //if (is_visible_in_tree()) + // shader_editor->get_text_edit()->grab_focus(); } } -- cgit v1.2.3