Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag'n'dropping a node onto its parent node in the scene tree selects it in the (2D) Editor, but not the Inspector #97696

Open
leogott opened this issue Oct 1, 2024 · 3 comments

Comments

@leogott
Copy link

leogott commented Oct 1, 2024

Tested versions

  • Reproducible in 4.3-stable

System information

Godot v4.3.stable - Pop!_OS 22.04 LTS - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 580 Series (RADV POLARIS10) - AMD Ryzen 7 7700X 8-Core Processor (16 Threads)

Issue description

When a node is selected in the scene tree, this updates the view in the 2D Editor and the Inspector to highlight the node there as well.
Under very specific circumstances, this update does not happen fully. In this case: drag'n'dropping a node onto its parent to put it as the lowest of the children highlights the node to be highlighted in the 2D Editor, but the Inspector does not update accordingly.

Steps to reproduce

  1. Create a scene with a root node and two distinguishable child nodes (eg. a Container with a label and a button)
  2. Select the lower node in the scene tree
  3. drag the upper node onto its parent in the scene tree

Minimal reproduction project (MRP)

N/A

@leogott
Copy link
Author

leogott commented Oct 1, 2024

While reporting #97702 I noticed another odd thing that I'm not sure counts as its own bug and fits in with this one:

multi-selecting nodes of one kind (via ctrl or shift click) does not update the inspector, even when the focused element in the scene tree changes.

@AeioMuch
Copy link
Contributor

After a bit of investigation I noticed that is is caused by the change made here : #61162

And specifically this :

void SceneTreeDock::_nodes_drag_begin() {
pending_click_select = nullptr;
}

It is not relevant anymore afaik, because at the time of the above PR the node was edited in the inspector when the mouse button was pressed, unlike now where it's when it's released.

Looks like just removing this avoid the issue. But maybe there's more to it ? What do you think ? cc @KoBeWi

@KoBeWi
Copy link
Member

KoBeWi commented Dec 31, 2024

Removing this will make the dragged node get selected when you drag it into the inspector. Have a node with NodePath property, drag another node to the property. The dragged node will be selected and inspector switches out of the node with the property. It's unwanted behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants