From 67640c84eb60238be7e75d1b0d9d937518f885fb Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Sat, 23 Jul 2016 21:25:00 +0200 Subject: Viewport: Replace obsolete "windows" group calls - Fixes neighbour focusing event propagation not being stopped --- scene/main/viewport.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'scene') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index bdb2754e5e..8faee0c549 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1782,7 +1782,6 @@ void Viewport::_gui_input_event(InputEvent p_event) { if (top->data.modal_exclusive || top->data.modal_frame==OS::get_singleton()->get_frames_drawn()) { //cancel event, sorry, modal exclusive EATS UP ALL //alternative, you can't pop out a window the same frame it was made modal (fixes many issues) - //get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); get_tree()->set_input_as_handled(); return; // no one gets the event if exclusive NO ONE } @@ -2062,7 +2061,6 @@ void Viewport::_gui_input_event(InputEvent p_event) { - //get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); get_tree()->set_input_as_handled(); @@ -2102,7 +2100,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { if (gui.key_event_accepted) { - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); + get_tree()->set_input_as_handled(); break; } } @@ -2162,7 +2160,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { if (next) { next->grab_focus(); - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); + get_tree()->set_input_as_handled(); } } @@ -2355,8 +2353,7 @@ void Viewport::_gui_control_grab_focus(Control* p_control) { if (gui.key_focus && gui.key_focus==p_control) return; - _gui_remove_focus(); - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_gui_remove_focus"); + get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"_viewports","_gui_remove_focus"); gui.key_focus=p_control; p_control->notification(Control::NOTIFICATION_FOCUS_ENTER); p_control->update(); @@ -2664,6 +2661,7 @@ void Viewport::_bind_methods() { ObjectTypeDB::bind_method(_MD("is_input_disabled"), &Viewport::is_input_disabled); ObjectTypeDB::bind_method(_MD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip); + ObjectTypeDB::bind_method(_MD("_gui_remove_focus"), &Viewport::_gui_remove_focus); ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"), _SCS("set_rect"), _SCS("get_rect") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"own_world"), _SCS("set_use_own_world"), _SCS("is_using_own_world") ); -- cgit v1.2.3