When having multiple TextureButtons that are overlapping, the events InputEventMouseMotion and InputEventScreenTouch is prioritized by the order they are added to the scenetree. The nodes added last have priority.
However, if the nodes are moved around in the scenetree using for instance Node.raise() or Node.move_child() etc, the old priority order is still kept. It's not updated.
This becomes a problem in the project I am working on, a Jigsaw game. So, when I drag pieces around I use raise() to have my dragged pieces to render on top. But if I have a bunch of pieces in a pile and then click on the pile, it's not the topmost piece that gets the event, it's the one that was last in the scenetree originally.
So, the render order seems to get updated, but the capture of events doesn't seem to get updated.
I have been experimenting with Godot 4.1 and the same problem seems to be around there as well.
Any suggestions how to solve this would be welcome, if anyone knows a workaround until the bug is fixed?