mirror of
https://github.com/godotengine/godot.git
synced 2024-12-03 09:52:18 +08:00
Fix crash when removing child during focus exit.
This commit is contained in:
parent
c1ad74d4c3
commit
f745299c36
@ -2427,10 +2427,12 @@ void Viewport::_gui_control_grab_focus(Control *p_control) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
get_tree()->call_group("_viewports", "_gui_remove_focus_for_window", (Node *)get_base_window());
|
get_tree()->call_group("_viewports", "_gui_remove_focus_for_window", (Node *)get_base_window());
|
||||||
gui.key_focus = p_control;
|
if (p_control->is_inside_tree() && p_control->get_viewport() == this) {
|
||||||
emit_signal(SNAME("gui_focus_changed"), p_control);
|
gui.key_focus = p_control;
|
||||||
p_control->notification(Control::NOTIFICATION_FOCUS_ENTER);
|
emit_signal(SNAME("gui_focus_changed"), p_control);
|
||||||
p_control->queue_redraw();
|
p_control->notification(Control::NOTIFICATION_FOCUS_ENTER);
|
||||||
|
p_control->queue_redraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewport::_gui_accept_event() {
|
void Viewport::_gui_accept_event() {
|
||||||
|
Loading…
Reference in New Issue
Block a user