You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
Input is not handled correctly in the provided reproduction project.
The project has a hierarchy Control -> Node2D -> Control.
Using set_as_toplevel(true) on the Node2D after adding it to the scene tree will cause the child Control to ignore input.
Removing and re-attaching the Node2D node will fix the behavior, letting the child Control receive input again.
If set_as_toplevel(true) is used before the Node2D is attached it works as expected.
Steps to reproduce:
See minimal reproduction.
Try to click the "click me" control. It will flash red if it received the click, but it doesn't work.
Click the top left button "Reattach"
Click the "click me" control again, it should now flash red when clicked.
You can move the set_as_toplevel(true) line in Main.gd to before the add_child call and it will also work.
Since the new node has a parent Control object and is not yet marked as top level, it does not get added as a gui root control (no call to get_viewport()->_gui_add_root_control(this)) in Control::_notification(NOTIFICATION_ENTER_CANVAS)
CanvasItem::set_as_toplevel() calls CanvasItem::_exit_canvas() and CanvasItem::_enter_canvas() when the node is in the tree, but those will not do a Control::_notification, so the gui root control will not be attached (or detached)
Godot version:
3.2.3
OS/device including version:
Window 10, 19041.508
Issue description:
Input is not handled correctly in the provided reproduction project.
The project has a hierarchy
Control -> Node2D -> Control
.Using
set_as_toplevel(true)
on the Node2D after adding it to the scene tree will cause the child Control to ignore input.Removing and re-attaching the Node2D node will fix the behavior, letting the child Control receive input again.
If
set_as_toplevel(true)
is used before the Node2D is attached it works as expected.Steps to reproduce:
See minimal reproduction.
You can move the
set_as_toplevel(true)
line inMain.gd
to before theadd_child
call and it will also work.Minimal reproduction project:
toplevel-bug.zip
The text was updated successfully, but these errors were encountered: