-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Create a virtual mouse move event after moving child nodes in tree (partially reverted) #66625
Conversation
f932862
to
74af0ee
Compare
74af0ee
to
e8aaced
Compare
e8aaced
to
d92b523
Compare
I checked your MRP in the issue and the signals seem to be emitted without mouse movement (in vanilla build). Can you confirm whether this PR is still relevant? |
Yes, I have verified, that the bug is still happening with v4.0.beta.custom_build [bc5d67c] on Linux X11 Xfce. I can't reproduce the bug on Windows 10 with v4.0.beta.custom_build [bc5d67c]. The likely reason for this is #20357. |
I could approve based solely on the code (as I can't test), but I'm wondering why you made |
The actual update needs to happen in a My impression was, that this scenario (where SubViewport and Window need to react differently to the same function-call) would be best solved by using virtual. A different way would be to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
Or actually... isn't this only relevant for Control nodes? Maybe the |
Interesting idea. I will investigate it. |
I had a look at this idea, which brought me to the following setting: What happens, if In this case neither
With this setting we are getting very close to the problem described in #42822. |
Soo is the original solution sufficient here? Or at least is it not something that would need to be reworked later to fix the other issues you mentioned? If yes, I think the PR is fine as is (still needs the comment tho). |
d92b523
to
363b827
Compare
Yes, it is.
The basic idea is to create a mouse move event in order to update mouse cursor and mouse-over state after a change in the SceneTree. I believe, that this method is the right way to do it, because otherwise we would need a different function, that does the same things as The other mentioned issue is a display-bug, as far as I understand it and will not interfere with cursor-updates. So I don't think, that the approach will need to be overhauled at a later time. However some fine-adjustments will be necessary, like #69318. Also I have updated the PR and included additional comments. It makes sense to document this behavior. |
363b827
to
26f01b3
Compare
26f01b3
to
3420226
Compare
This was discussed in PR-review-meeting. |
Please move to 4.1 |
I guess this PR can be revised after #75701 was merged. |
3420226
to
e99ae86
Compare
This updates mouse cursor and mouse-over-states without the need for additional mouse movements.
e99ae86
to
ce10ca6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks! |
This patch updates mouse cursor and mouse-over states without the need for additional mouse movements after a
Node::move_child
. It utilizes the infrastructure introduced in #58995 for updating the mouse cursor on scene changes.resolve #40012
Update 2022-10-02: Add check, that base_window exists
Update 2022-11-03: Resolve merge conflict
Update 2022-11-12: Resolve merge conflict
Update 2023-01-06: Expose
update_mouse_cursor_state
to GDScript in order to close godotengine/godot-proposals#6052Update 2023-01-28: Resolve merge conflict
Update 2023-05-29: Address changes of #75701 and resolve merge conflict