Fix using arrow keys to move object when move tool is selected causes changed of focus #71856
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.
Fixes #70789
What a goose chase this was. Turns out inside the
_gui_input
handling, we call_update_cursor()
, which in turn pushes a mouse motion event to the viewport. This RESETS thegui.key_event_accepted
to false, when the move tool already accepted the event and set it to true!So the fix here is actually to ensure
viewport->set_default_cursor_shape(c);
(at the bottom of_update_cursor()
) never gets called because the new cursor is same as current.This might need to be looked into as this was quite a hard bug to find due to that interaction. Simplfied, this was happening:
update_cursor()
dispatches an event to the viewport viaviewport->set_default_cursor_shape(c);
gui.key_event_accepted
- it is now false! When it should be true since move tool handled the event