Open hsandt opened 1 year ago
Do you use X11 or Wayland? Can confirm issue on X11-Xfce v4.1.beta.custom_build [72b59325c].
Can confirm the first (main) issue with the root-node being selected.
Second issue I could not replicate.
X11 (though this might only matter for the 2nd issue).
Tested on current master (a278c1b98a81738a35b96a933a6e6cf771f9ab2d).
I use X11.
Second issue I could not replicate.
Could not replicate second issue (root focused, child node dragged) on v4.2.1.stable.official [b09f793f5], and since my project configuration changed since (and I'm too lazy to investigate my Git history to find the exact spot where it happened), I'm removing this sub-issue. Even If it happened again, their causes may be different so I'd reopen a different issue anyway.
It seems that the problem occurs here in the SceneTreeDock. When clicking on the root item, the click is outside of the child SceneTreeEditor's rectangle. Since tree_clicked
isn't set, the selection handler ends up pushing the target node immediately as the new edited node. I added some debug prints that you can see in this screencast (sorry the mouse pointer doesn't show up).
Here's the text from clicking on 2 children of the root node and then the root node:
scene tree rect: [P: (0, 50), S: (393, 501)], local mouse pos: (125, 79), has point: yes
scene tree rect: [P: (0, 50), S: (393, 501)], local mouse pos: (119, 114), has point: yes
scene tree rect: [P: (0, 50), S: (393, 501)], local mouse pos: (81, 15), has point: no
The SceneTreeEditor rectangle starts at y=50 below the root node. It seems like the SceneTreeEditor rectangle is wrong, but maybe this isn't the right way to check if the mouse click was inside a particular child node.
Godot version
v4.0.2.stable.official [7a0977ce2]
System information
Linux Ubuntu 22.04 with Unity desktop
Issue description
Every time I try to assign the root node to an inspector Assign... field, I lose the node focus so the Inspector changes and I cannot complete the drag-and-drop action.
It also sometimes happened with other nodes: when focusing root node and trying to drag a child node; or even when focus some child node and trying to drag another child node.Unfortunately, I could not reproduce the bug above in a fresh new project; it only happened in my full-fledged project.
=> So I'm removing this bug variant from this issue.
Steps to reproduce
Expected: inspector should lock selection Actual: inspector focuses on root node
And you can even try the variants to drag other nodes too, in your own projects, which may trigger the bug as more complex setup seem to trigger it more often (even if a brand new scene!)
Minimal reproduction project
v4.0.2 - Drag and drop another node sometimes doesnt lock inspector.zip