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 that button presses don't set event as handled in AcceptDialog #77765

Merged

Conversation

Sauermann
Copy link
Contributor

resolve #77752
alternative to #77763

When clicking with the mouse on the OK-button of an AcceptDialog, the mouse event is not set to as handled.
This bug got uncovered by #77452, which removed a redundant is_inside_tree-check.
This is a more localized approach in comparison to #77763.

@Sauermann Sauermann requested a review from a team as a code owner June 2, 2023 09:14
@KoBeWi KoBeWi added this to the 4.1 milestone Jun 2, 2023
@KoBeWi
Copy link
Member

KoBeWi commented Jun 2, 2023

This goes further though. The _ok_pressed() is just a callback for pressing the button. Shouldn't the event be handled by the button, which is the node that receives it?
(this also means that buttons never accepted the click events??)

@RedworkDE
Copy link
Member

I did some more digging and the best way to avoid issues like this is probably to avoid removing the node in the event handler by deferring the hiding like the abort handler does by replacing set_visible(false); on line 124 with call_deferred(SNAME("hide"));.

The set_input_as_handled from this PR should probably be added anyways, unless we move that to Button (tho that should definitely be a different PR, as that probably breaks things)

@akien-mga akien-mga merged commit e7d2e49 into godotengine:master Jun 5, 2023
@akien-mga
Copy link
Member

Thanks!

@Sauermann Sauermann deleted the fix-acceptdialog-event-handled branch July 5, 2023 10:54
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.

Confirming a warning dialog crashes the editor
4 participants