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

Fix a special case for button masks #89926

Merged

Conversation

Sauermann
Copy link
Contributor

In certain situations it is possible that in a Viewport the same mouse button is pressed twice in series without releasing it in between.
In this case, focus stealing should happen to ensure, that the mouse button is not sent unintentionally to the previously focused Control node.

resolve #89917

@Sauermann Sauermann added this to the 4.3 milestone Mar 26, 2024
@Sauermann Sauermann requested a review from a team as a code owner March 26, 2024 21:30
@akien-mga
Copy link
Member

This seems to break CodeEdit unit tests:

./tests/scene/test_code_edit.h:3078:
TEST CASE:  [SceneTree][CodeEdit] completion
  [CodeEdit] autocomplete completion

./tests/scene/test_code_edit.h:3527: ERROR: CHECK( code_edit->get_code_completion_selected_index() == -1 ) is NOT correct!
  values: CHECK( 2 == -1 )

./tests/scene/test_code_edit.h:3528: ERROR: CHECK( code_edit->get_line(0) == "item_2" ) is NOT correct!
  values: CHECK( i == item_2 )

./tests/scene/test_code_edit.h:3539: ERROR: CHECK( code_edit->get_line(0) == "i" ) is NOT correct!
  values: CHECK( iT == i )

In certain situations it is possible that in a `Viewport` the same
mouse button is pressed twice in series without releasing it in
between.
In this case, focus stealing should happen to ensure, that the
mouse button is not sent unintentionally to the previously focused
Control node.
@Sauermann Sauermann force-pushed the fix-button-mask-special-case branch from 1baf234 to 48ea019 Compare March 28, 2024 19:23
@Sauermann Sauermann requested a review from a team as a code owner March 28, 2024 19:23
@Sauermann
Copy link
Contributor Author

Adjusted unit-tests: for a mouse double click it is necessary that the mouse is released between the first and the second click.

@akien-mga akien-mga merged commit 4abe918 into godotengine:master Apr 4, 2024
16 checks passed
@Sauermann Sauermann deleted the fix-button-mask-special-case branch April 4, 2024 12:46
@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.

Buttons that miss mouse up events consume unrelated clicks afterwards
2 participants