Skip to content

Commit 9a1ea96

Browse files
committed
Fix push_input only working the first time
Subviewports didn't update their parent's local_input_handled correctly. Fixes godotengine#76439.
1 parent 7e76141 commit 9a1ea96

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

scene/main/viewport.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,6 +2945,16 @@ void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) {
29452945
}
29462946

29472947
local_input_handled = false;
2948+
if (!handle_input_locally) {
2949+
Viewport *vp = this;
2950+
while (true) {
2951+
if (Object::cast_to<Window>(vp) || !vp->get_parent()) {
2952+
break;
2953+
}
2954+
vp = vp->get_parent()->get_viewport();
2955+
}
2956+
vp->local_input_handled = false;
2957+
}
29482958

29492959
Ref<InputEvent> ev;
29502960
if (!p_local_coords) {

0 commit comments

Comments
 (0)