From 21bdadbf79a24c8d3a67da819ef97f0f953f15ec Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 13 Apr 2022 18:09:51 -0300 Subject: [PATCH] Fix `GridContainer` not ignoring toplevel children (cherry picked from commit 506d8ba526188bb683eeb4e4389c8bd4a18abab8) --- scene/gui/grid_container.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 87113b82f86..e1ed8d6d942 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -50,6 +50,9 @@ void GridContainer::_notification(int p_what) { if (!c || !c->is_visible_in_tree()) { continue; } + if (c->is_set_as_toplevel()) { + continue; + } int row = valid_controls_index / columns; int col = valid_controls_index % columns;