Skip to content
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

Update mouse cursor shape after changes #58995

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

Sauermann
Copy link
Contributor

resolves #45936
supersedes #58913

This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.

#58913 introduced a bug that caused a recursive call loop (#58960) for AnimationTimelineEdit and AnimationTrackEditTypeAudio, both of which change the default cursor shape on every mouse move event:

InputEventMouseMove -> set_default_cursor_shape() -> update_mouse_cursor_shape() -> InputEventMouseMove -> loop back

This patch makes sure that the recursion loop is broken in Control::set_default_cursor_shape(), which is a prudent safeguard.
I verified, that I can not reproduce #58960 with this patch.

A different alternative to resolve the recursive loop would be to not use set_default_cursor_shape during every mouse move in AnimationTimelineEdit::gui_input and AnimationTrackEditTypeAudio::gui_input.
It feels strange, that a MouseMove event would change the default cursor shape, since there is Control::get_cursor_shape for such cases, in which a Control-Node displays different cursor shapes.

This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.
@akien-mga akien-mga merged commit e3464c8 into godotengine:master Sep 28, 2022
@Sauermann Sauermann deleted the fix-mouse-cursor-change-2 branch September 28, 2022 18:52
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mouse cursor shape is not updated after scene change
4 participants