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

Make mouse_focus and mouse_focus_mask consistent for force_drag #91425

Merged
merged 1 commit into from
May 2, 2024

Conversation

Sauermann
Copy link
Contributor

In Viewport::_gui_force_drag currently Viewport::gui.mouse_focus gets cleared, but Viewport::gui.mouse_focus_mask doesn't get cleared.

This is an inconsistency which can cause a crash.

With the change of this PR, mouse_focus_mask also gets cleared. This is in alignment with how regular drag and drop clears both variables.

resolve #91387

In `Viewport::_gui_force_drag` currently `Viewport::gui.mouse_focus`
gets cleared, but `Viewport::gui.mouse_focus_mask` doesn't get cleared.

This is an inconsistency which can cause a crash.

With the change of this PR, `mouse_focus_mask` also gets cleared.
This is in alignment with how regular drag and drop clears both variables.
@Sauermann Sauermann added this to the 4.3 milestone May 1, 2024
@Sauermann Sauermann requested a review from a team as a code owner May 1, 2024 22:14
@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label May 2, 2024
@akien-mga akien-mga merged commit b2af040 into godotengine:master May 2, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga changed the title Make mouse_focus and mouse_focus_mask consistent for force_drag Make mouse_focus and mouse_focus_mask consistent for force_drag May 2, 2024
@Sauermann Sauermann deleted the fix-force-drag-focus-crash branch May 3, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release crash topic:gui topic:input
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using force_drag from a Control's gui_input signal crashes with no errors with multiple mouse input buttons.
2 participants