浏览代码

Unfocus Control on NOTIFICATION_EXIT_TREE

(cherry picked from commit be2d59fa0a77d60b19748a304fb74c386dd8e114)
PucklaMotzer09 3 年之前
父节点
当前提交
05eb33e701
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/control.cpp

+ 1 - 1
scene/gui/control.cpp

@@ -472,7 +472,7 @@ void Control::_notification(int p_notification) {
 		} break;
 		case NOTIFICATION_EXIT_TREE: {
 			ERR_FAIL_COND(!get_viewport());
-
+			release_focus();
 			get_viewport()->_gui_remove_control(this);
 
 		} break;