Update mouse cursor shape after changes #58995
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andAnimationTrackEditTypeAudio
, 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 inAnimationTimelineEdit::gui_input
andAnimationTrackEditTypeAudio::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.