Prevent selecting when a CanvasItem is selected
https://github.com/godotengine/godot/pull/86804 made it possible to select CanvasItems when any tool is active. However it has an unwanted side-effect that you can select CanvasItems while another CanvasItem is already selected, if that CanvasItem can't be interacted with using the current tool. This PR prevents that, i.e. trying to move/rotate/scale a "locked" CanvasItem results in no-op. Note that "locked" includes actually locked nodes, nodes inside viewport or invisible nodes.
Fixes #92072
CC @ryevdokimov
This is not a hill I'm willing to die on, but I'm curious in your opinion why no-op is preferable to selection in this scenario? From my perspective if the user is trying to move or rotate something for example, why not let them without having to switch to the select tool or use the scene tree dock?
I think only Select tool should allow selecting. The exception is when you have nothing selected, so selecting is the only option to get started. Once you have a CanvasItem selected, showing a selection box can be unexpected and confusing (like imagine you try to move a node, but forgot to unlock it and wonder why your move tool is selecting things). I could maybe add a toaster message, similar to when you try to move a Control inside Container.
Fair enough. I guess it depends on just what your expectations are and what you're used to. I'm personally in the camp of all tools should just always be able to select to prevent: https://github.com/godotengine/godot/issues/87608 and so the behavior is always consistent. No-op to me in general is more confusing, because it lacks any feedback on what is supposed to happen, but if this the direction we go I agree that a toaster message after repeated no-op could be helpful.
https://github.com/godotengine/godot/assets/2223172/70af52c2-4d7c-43ee-828f-715323a75f8c
Thanks!