Merge pull request #30510 from sparkart/master

Fix GraphNode immediately losing focus
This commit is contained in:
Rémi Verschelde 2019-07-15 08:02:14 +02:00 committed by GitHub
commit 71cd4fa40d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -599,6 +599,8 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
Vector2 mpos = Vector2(mb->get_position().x, mb->get_position().y); Vector2 mpos = Vector2(mb->get_position().x, mb->get_position().y);
if (close_rect.size != Size2() && close_rect.has_point(mpos)) { if (close_rect.size != Size2() && close_rect.has_point(mpos)) {
//send focus to parent
get_parent_control()->grab_focus();
emit_signal("close_request"); emit_signal("close_request");
accept_event(); accept_event();
return; return;
@ -615,9 +617,7 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
return; return;
} }
//send focus to parent
emit_signal("raise_request"); emit_signal("raise_request");
get_parent_control()->grab_focus();
} }
if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {