Skip to content

Commit

Permalink
Fix push_input only working the first time
Browse files Browse the repository at this point in the history
Subviewports didn't update their parent's local_input_handled correctly.

Fixes #76439.
  • Loading branch information
Jummit committed Dec 2, 2023
1 parent a83eb16 commit 7957354
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,16 @@ void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) {
}

local_input_handled = false;
if (!handle_input_locally) {
Viewport *vp = this;
while (true) {
if (Object::cast_to<Window>(vp) || !vp->get_parent()) {
break;
}
vp = vp->get_parent()->get_viewport();
}
vp->local_input_handled = false;
}

Ref<InputEvent> ev;
if (!p_local_coords) {
Expand Down

0 comments on commit 7957354

Please sign in to comment.