Prevent selecting the hovered node if the mouse is not inside the inspector dock #96124
+25
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #94320
Also fixed the fact that the hovered&inspected node was not added to the selection history.
It will only select the hovered&inspected node if the mouse is inside the inspector at the end of the drag.
To reinspect the current selection, I went with the method of reselecting everything. Sadly selecting nodes is a bit slow if you select a lot of them, but that's a general issue.
I also moved the code that was happening when the mouse button was released, inside the
NOTIFICATION_DRAG_END
instead, to centralize stuff more. This made me realize there was a duplicate call to_reset_hovering_timer()
left, and also a signal connection that was useless (_reset_hovering_timer()
is already called in_handle_hover_to_inspect()
anyway), and more importantly not connected to correct thing so it was not working.