summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-16 22:41:10 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-16 22:41:10 -0300
commit72fcb8a35beab251d01864bc67da3e3a8e75aed6 (patch)
tree9ad5837e4237d1071a9e1a5b40efdaffa3f89f33 /tools
parent40818299231fe1854635ffe36d8b9565f430b35f (diff)
-Moved all the "root" input handling for GUI from individual Controls to Viewport.
-Should fix several reported bugs when controls don't have a common parent This may have added new bugs, so please report if so!
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_node.cpp3
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp2
-rw-r--r--tools/editor/scene_tree_editor.cpp6
4 files changed, 5 insertions, 8 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index d664a91c47..b933e2148a 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -4964,8 +4964,9 @@ EditorNode::EditorNode() {
//scene_root_base->add_child(scene_root);
- scene_root->set_meta("_editor_disable_input",true);
+ //scene_root->set_meta("_editor_disable_input",true);
VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport(),true);
+ scene_root->set_disable_input(true);
scene_root->set_as_audio_listener_2d(true);
scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height")));
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 2eaf017d08..139d849119 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -194,7 +194,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) {
void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) {
- if (!is_visible() || window_has_modal_stack())
+ if (!is_visible() || get_viewport()->gui_has_modal_stack())
return;
if (p_ev.key.mod.control)
// prevent to change tool mode when control key is pressed
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index e47dcbf30f..ab5a20fa29 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -3529,7 +3529,7 @@ void SpatialEditor::_instance_scene() {
void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
- if (!is_visible() || window_has_modal_stack())
+ if (!is_visible() || get_viewport()->gui_has_modal_stack())
return;
{
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index 531fe83bc3..ea7d760133 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -39,12 +39,8 @@
Node *SceneTreeEditor::get_scene_node() {
ERR_FAIL_COND_V(!is_inside_tree(),NULL);
- if (get_tree()->get_root()->get_child_count() && get_tree()->get_root()->get_child(0)->cast_to<EditorNode>())
- return get_tree()->get_root()->get_child(0)->cast_to<EditorNode>()->get_edited_scene();
- else
- return get_tree()->get_root();
- return NULL;
+ return get_tree()->get_edited_scene_root();
}