-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Area2D and Area3D don't trigger the mouse_entered and mouse_exited when dragging from a Control #75120
Comments
Drag&Drop operations currently works by maintaining focus on the Control, that initially started the D&D-operation. |
Do you know if there is a way to workaround this behavior? Maybe by telling the Control to lose this focus on click someway? Thanks! |
As a workaround you can manually poll the mouse position and check if it overlaps. |
This issue has changed with version 4,1 and 4.1.1. Now Area2D and Area3D trigger the mouse_entered and mouse_exited signals if the mouse is dragging from inside a Control. But, if a Control is over an Area, no matter if the Control has the mouse_filter on Stop, the Area will capture the mouse. Is this ok? mouse_hover_2.mp4 |
Well, the documentation of MOUSE_FILTER_STOP mentions only that it prevents passing event to other controls, it doesn't mention physic objects. Although I think it makes sense to block it 🤔 Also tree order doesn't seem to matter at all. |
That is not ok and a regression from #78017. |
The mentioned fix got included in Godot 4.2 dev-2. |
I've tested the 4.2 dev-2. Now the Control blocks the Area when it's over it. But, if I release the mouse button when I'm hovering the Control, the Area ignores the Control and captures the mouse. mouse_hover_3.mp4 |
@IvanIG3 thanks for testing, but unfortunately I can't replicate the behavior, that you are describing in v4.2.dev2.official [da81ca6] on Linux X11 Xfce and on Windows 10. My procedure for testing:
After step 5, for me the Area2D is not filled with red color. Is it possible, that we use different project files? |
@Sauermann Ah yes, you are right. I had something messed up with the project. I downloaded the MRP and tested it again and it works fine now. Sorry for the confusion. |
@IvanIG3 thanks for the clarification. Just to double check I would like to get confirmation from you, if you consider the original problem to be solved now, so that this issue can be closed now. |
Yes, the original problem is solved now and the issue can be closed. |
Godot version
4.0.stable
System information
Windows 10
Issue description
The Area2D and the Area3D do not trigger the signals mouse_entered and mouse_exited if the mouse is dragging from inside a Control. But, a Control triggers the signals mouse_entered and mouse_exited when dragging from another Control.
I don't know if this is intended, or it is a bug, but I think that the two nodes should behave the same.
mouse_hover.mp4
Steps to reproduce
Execute the project below. When hovering the "Area" and the "Control", the color_rect turns red. But if dragging from the "Drag", only the "Control" turns red.
Minimal reproduction project
MouseInputTest.zip
The text was updated successfully, but these errors were encountered: