From 2f19260fb7b7479eab6ad905683cbef8126fc0e8 Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 29 Dec 2015 10:01:29 -0300 Subject: [PATCH] -restrict gui root from being removed while performing input, fixes #2578 --- scene/gui/control.cpp | 5 +++++ scene/main/node.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ec4886a6ace..6e867c45b91 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -916,6 +916,7 @@ void Control::_window_show_tooltip() { void Control::_window_call_input(Control *p_control,const InputEvent& p_input) { + _block(); while(p_control) { @@ -932,6 +933,9 @@ void Control::_window_call_input(Control *p_control,const InputEvent& p_input) { break; p_control=p_control->data.parent; } + + _unblock(); + } void Control::_window_input_event(InputEvent p_event) { @@ -1067,6 +1071,7 @@ void Control::_window_input_event(InputEvent p_event) { Size2 pos = mpos; pos = window->focus_inv_xform.xform(pos); + window->mouse_over->drop_data(pos,window->drag_data); window->drag_data=Variant(); //change mouse accordingly diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 2b2a188e76a..f5252cf4461 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -802,6 +802,7 @@ void Node::remove_child(Node *p_child) { } ERR_FAIL_COND( idx==-1 ); + ERR_FAIL_COND( p_child->data.blocked > 0 ); //if (data.scene) { does not matter