From ed9b230744eb5dbb3a5e956c32ea87791abed68c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 14 Jan 2019 13:16:19 -0300 Subject: [PATCH] Hide visible popups by default if visible when entering tree, unless on editor. Fixes #24737 --- scene/gui/popup.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index c733319cd4f..2d2c54594ac 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -52,9 +52,13 @@ void Popup::_notification(int p_what) { //small helper to make editing of these easier in editor #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + //edited on editor set_as_toplevel(false); - } + } else #endif + if (is_visible()) { + hide(); + } } }