-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 push_input
events not going through after first pressed mouse event
#77730
Conversation
This PR was discussed in a recent Input-PR review meeting together with #77926. |
This PR should be considered for 4.2 as a non-compatibility breaking alternative to #77926. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplification suggestion
Subviewports didn't update their parent's local_input_handled correctly. Fixes godotengine#76439.
a4aa6d7
to
7957354
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified the problem of the linked issue and verified, that the MRP accurately represents the problem.
The MRP is still a problem in current master and this PR (rebased on [b9a3bd2]) solves the problem.
The code is in alignment with preexisting code
Lines 3657 to 3673 in d76c1d0
if (!handle_input_locally) { | |
ERR_FAIL_COND(!is_inside_tree()); | |
Viewport *vp = this; | |
while (true) { | |
if (Object::cast_to<Window>(vp)) { | |
break; | |
} | |
if (!vp->get_parent()) { | |
break; | |
} | |
vp = vp->get_parent()->get_viewport(); | |
} | |
if (vp != this) { | |
vp->set_input_as_handled(); | |
return; | |
} | |
} |
While I believe that #77926 (removal of handle_input_locally
) is a better solution in the long term, I consider it unlikely that it will get reviews in the near future, so at the moment the best approach to fix the linked issue is this PR.
Thanks! |
Subviewports didn't update their parent's local_input_handled correctly.
The patch is basically the inverse of
set_input_as_handled
.There is a small chance that this change is not the way to fix the issue, but it didn't create any problems in my case.
Fixes #76439.
Off-topic: Wow, that's some fast CI! Thanks Akien!