godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.3k stars 21.06k forks source link

Changing parent node for FileDialog when it's visible will block any input in the editor #68575

Closed marzecdawid closed 1 year ago

marzecdawid commented 1 year ago

Godot version

4.0.beta4

System information

Windows 10 21H2, Vulkan, AMD Radeon RX 6750 XT (31.0.12029.1042)

Issue description

Changing the type of the parent node for the FileDialog when the FileDialog is set to be visible in the Editor will block any input for the Editor (mouse, keyboard inputs as well as close button).

Video showing the problem

This also happens for other nodes, for example AcceptDialog

It does not happen in Godot 3.5.1

Steps to reproduce

  1. Create a scene with Node2D
  2. Add a FileDialog node as a child to Node2D
  3. Change the visibility of the FileDialog node so it is visible in the editor: obraz
  4. Change the type of the Node2D to Control

Minimal reproduction project

No response

Sauermann commented 1 year ago

Can confirm this on Linux. If the changed node (Node2D) is not the root-element, the bug doesn't happen.

Rindbee commented 1 year ago

https://github.com/godotengine/godot/blob/c17f17eb98188a7134c85bdbdf0123127c462046/scene/main/window.cpp#L515-L517 https://github.com/godotengine/godot/blob/c17f17eb98188a7134c85bdbdf0123127c462046/scene/main/window.cpp#L227-L233

When replacing the scene root node, here get_tree()->get_edited_scene_root() should be the new node, but actually still get the old one.

https://github.com/godotengine/godot/blob/c17f17eb98188a7134c85bdbdf0123127c462046/scene/main/node.cpp#L2405-L2418

For the root of the edited scene, it should be notified on line 2410 that the scene root has been changed.