From a1fdb0accbf7c074aa2c8a7af7e925ea352fe37a Mon Sep 17 00:00:00 2001 From: Mike <44955015+jdbool@users.noreply.github.com> Date: Sun, 21 Jun 2026 17:00:26 -0700 Subject: [PATCH] Fix crash in Tree::_get_item_focus_rect --- scene/gui/tree.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 01a1c9ebbf..4d75ae7fbb 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -5160,7 +5160,10 @@ void Tree::_notification(int p_what) { } break; case NOTIFICATION_VISIBILITY_CHANGED: { - drag_touching = false; + if (!is_visible()) { + drag_touching = false; + popup_editor->hide(); + } } break; case NOTIFICATION_DRAG_END: { @@ -5642,7 +5645,7 @@ void Tree::_notification(int p_what) { case NOTIFICATION_RESIZED: case NOTIFICATION_TRANSFORM_CHANGED: { - if (popup_edited_item != nullptr) { + if (popup_edited_item != nullptr && popup_editor->is_visible()) { Rect2 rect = _get_item_focus_rect(popup_edited_item); popup_editor->set_position(get_screen_position() + rect.position);