From be2d59fa0a77d60b19748a304fb74c386dd8e114 Mon Sep 17 00:00:00 2001 From: PucklaMotzer09 Date: Sun, 26 Dec 2021 17:53:07 +0100 Subject: [PATCH] Unfocus Control on NOTIFICATION_EXIT_TREE --- scene/gui/control.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 1fdc30eb6df..1d988cd7d0e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -589,6 +589,7 @@ void Control::_notification(int p_notification) { _size_changed(); } break; case NOTIFICATION_EXIT_TREE: { + release_focus(); get_viewport()->_gui_remove_control(this); } break; case NOTIFICATION_READY: {